Current location: Hot Scripts Forums » Programming Languages » PHP » show tables question

show tables question

 
Prev Previous Post   Next Post Next
  #1  
Old 04-19-09, 03:08 PM
maklooby maklooby is offline
Newbie Coder
 
Join Date: Feb 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
show tables question

I'm trying to use the SHOW TABLES command in order to show my tables that I've created in mysql database. HOwever, I have questions.

My code:
$sql="SHOW TABLES FROM food";
$result=mysql_query($sql);
if (!$result) {
echo "DB Error, could not list tables\n";
echo 'MySQL Error: ' . mysql_error();
exit;
}
while ($row = mysql_fetch_row($result)) {
echo "Table: {$row[0]}\n";
}

mysql_free_result($result);
?>

The output does show the tables. BUT it shows the word TABLE in front of my table names. I do not want the word table to show up. In fact, I would actually if posible like my tables to be links that a user can click on to bring up information (or in my case more php code of that link. I just thought that displaying the tables is better than manually creating an array and changing each time someting gets done...less tedious anyways.
Any suggestions on this? Thanks
Reply With Quote
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
slide show question maklooby JavaScript 4 03-13-09 08:03 PM
question about tables mejnoona PHP 6 12-06-08 03:19 AM
Show Tables blinn_shade PHP 10 09-26-07 01:22 AM
borders dont show in firefox (tables) Bazzio CSS 5 09-05-05 04:43 PM
tables and PHP, odd question eq1987 PHP 3 07-04-04 01:30 PM


All times are GMT -5. The time now is 04:14 AM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2 (Unregistered)