User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Nov 2007
Posts: 96
Reputation: kings is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
kings's Avatar
kings kings is offline Offline
Junior Poster in Training

display the data into listbox

  #1  
Feb 29th, 2008
  1. <html>
  2. <head></head>
  3. <body>
  4. <?php
  5. $hostname="localhost";
  6. $username="jesus_jesus";
  7. $password="jesus";
  8. $dbid="jesus_jesus";
  9. $link=mysql_connect($hostname,$username,$password);
  10. mysql_select_db($dbid) or die("unable to connect");
  11. $result=mysql_query("select jid,industrytype from career");
  12. if($result)
  13. {
  14. echo '<select>';
  15. while($myrow = mysql_fetch_array($result))
  16. {
  17. echo '<option value="',$myrow['$industrytype'],'"></option>';
  18. }
  19. echo "</select>";
  20. }
  21. ?>
  22. </body>
  23. </html>
in this code i'm getting only the listbox.not to able to retrive the data from the database..


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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 240
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: display the data into listbox

  #2  
Feb 29th, 2008
You are getting the listbox and the values but you can see it, because you don't have the value between <option></option>.
Ie.,
  1. 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*
Reply With Quote  
Join Date: Mar 2008
Location: South Africa
Posts: 24
Reputation: cVz is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
cVz's Avatar
cVz cVz is offline Offline
Newbie Poster

Re: display the data into listbox

  #3  
24 Days Ago
Hey guys , thanks for the help on that
Delphi & C# programmer deluxe...
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 5:23 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC