PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old April 14th, 2004, 02:09 AM
metoome metoome is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 18 metoome User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 38 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old April 14th, 2004, 08:53 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Help in PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway