Posted by Samuλl van Laere on 07/01/06 22:18
I've been trying to "update" an function I use to something better.
Basicly I need to grab all tablenames in a mysql database:
function GrabTables($dbname){
$sql = "SHOW TABLES FROM $dbname";
$result = mysql_query($sql);
while ($row = mysql_fetch_row($result)) {
echo "{$row[0]}\n";
$tables = array($row[0]);
}
return $tables;
}
The echo "{$row[0]}\n"; indeed prints all table names.
But I need to pass those as an array to another function.
And thats my problem, cause I can't get it to work.
$tables doesn't return an array.
Any thoughts?
Cheers,
Samuel
Navigation:
[Reply to this message]
|