|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Help in PHP
hello ..i am trying to create a dropdown box which lists the tables in the data base..
i tried the following code.. what i was getting was just this but there were no table names listed inside the dropdown box.. Select the Name of the Tables : <?php require_once('DB.php'); $connection="mysql://root@localhost/doondo"; $db=DB::Connect($connection); if(DB::isError($db)) { die($db->getMessage()); } $sql="show tables"; if(DB::isError($sql)) { die($db->getMessage()); } //returns array of all rows returned by the query $results=$db->getAll($sql); if(DB::isError($results)) { die($db->getMessage()); } ?> <html><body><table> Select the Name of the Tables :<select name="Tables" size="1"> <? while ($row=$results->fetchRow(DB_FETCHMODE_OBJECT)){ ?> <option value=<?$row[0]?>> </option> <? } ?> </select> </body></html> i would also like use the query to fetch dyanamically.. i.e., to get the input from the user and display or fetch data's or create listbox , depending upon it.. so can any one provide me some links based on this... i use red hat 9,PHP 4.0, MySQL and learning to query using PEAR DB.. thanks in advance |
|
#2
|
||||
|
||||
|
Download phpmyadmin and either use it in place of what you're trying to program or investigate how they're listing dbs, tables, etc. Should be a snap once you get a look under the hood of this software.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Help in PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|