•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 423,531 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,324 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1061 | Replies: 2
![]() |
PHP Syntax (Toggle Plain Text)
<html> <head></head> <body> <?php $hostname="localhost"; $username="jesus_jesus"; $password="jesus"; $dbid="jesus_jesus"; $link=mysql_connect($hostname,$username,$password); mysql_select_db($dbid) or die("unable to connect"); $result=mysql_query("select jid,industrytype from career"); if($result) { echo '<select>'; while($myrow = mysql_fetch_array($result)) { echo '<option value="',$myrow['$industrytype'],'"></option>'; } echo "</select>"; } ?> </body> </html>
i'm having two column jobid and industrytype in the table career.i want to display the industry type in listbox.
Problem:
in this code i'm getting only the listbox.not to able to retrive the data from the database..
Last edited by MattEvans : Feb 29th, 2008 at 4:54 am. Reason: Added code tags
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 240
You are getting the listbox and the values but you can see it, because you don't have the value between <option></option>.
Ie.,
Ie.,
php Syntax (Toggle Plain Text)
echo '<option value='.$myrow['$industrytype'].'>'.$myrow['$industrytype'].'</option>';
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access advice breach broadband business classification code combo crime cult of the dead cow daniweb data data protection data transfer database drive dropdownlist encryption europe forensic forensics fun google government hacking hard hardware help hitachi hp industrial espionage information internet it linux module net news payment services privacy protection reuse search security storage terabyte tutorials and more web wikipedia you tried to assign the null value to a variable that is not a variant data type
- loading data to listbox from database (Visual Basic 4 / 5 / 6)
- fill listbox with data from another table (Visual Basic 4 / 5 / 6)
- Display data in separate controls (SQL) (VB.NET)
- Loading a Tkinter Listbox (Python)
- listbox hiccup (Visual Basic 4 / 5 / 6)
- Listbox (Visual Basic 4 / 5 / 6)
- overwriting files. (Visual Basic 4 / 5 / 6)
- Saving information from .NET Listbox into SQL Server 2000 (ASP.NET)
- Listbox selectedItem.value cannot be retrieved (ASP.NET)
- Populating & Retrieving Data in a listbox : ASP.NET (w/ VB.NET) (ASP.NET)
Other Threads in the PHP Forum
- Previous Thread: MySQL/Directory Member Photo Upload script trouble ...
- Next Thread: Rather complicated PHP project for novice



Linear Mode