need help with "SHOW Colums"
| From: | David Rice | Date: | Thu, 31 Oct 2002 16:31:58 +0000 |
| Subject: | need help with "SHOW Colums" | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-22850@lists.php.net to get a copy of this message | ||
mysql_select_db("filterseveuk");
$query = ( " SHOW COLUMNS FROM user ");
$result = mysql_query ( $query ) or die( mysql_error () );
while ( $row = mysql_fetch_array ($result) ){
$x = 0 ;
echo $row[$x] ;
$x++ ;
}
I would like to replace the table name "user" with a variable $table, that
wil automatically take the value of the selected table. I have tried many
times but cannot get the correct sql syntax, it keeps saying
"you have an error in your sql syntax near 'user' line 1" when i try it with
$table.
any ideas??
thank's,
dave rice (haloplayer@hotmail.com)
_________________________________________________________________
Choose an Internet access plan right for you -- try MSN! http://resourcecenter.msn.com/access/plans/default.asp