The problem is that the database name is defined in a variable at the top of the script, like so:
$db = "DB";
The variable $db is then used in the query, and the subsequent exec call
$show_q = "SHOW TABLES FROM $db"; $show_a = mysql_fetch_array($show_r); $show_rows = mysql_numrows($show_r);
for ($i = 0; $i < $show_rows; $i++) {
$show_a = mysql_fetch_array($show_r);
exec("mysqldump -uroot --opt $db $show_a[Tables_in_$db] > ..\admin\dbbackups\\$show_a[Tables_in_$db].sql");
}
But I am getting a parse error for Tables_in_$db - how do I correctly use the variable $db within the variable $show_a[Tables_in_$db]?
Thanks,
-Lisi
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php