user00265
2-26-04, 02:13 PM
Hello there, I have been using this script for some time now, but since they were moved to the FTP servers I've been having errors with them.
The email I get with the error is:
Error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
But since I know the basics on how to query a MySQL server for the data I need, I am asking for assistance.
Here is the script (originally written by HalfaBee):
<?
mysql_connect("mysql03.powweb.com","username","password") or die("Error: ".mysql_error());
mysql_select_db("database") or die("Error: ".mysql_error());
$tables = "OPTIMIZE TABLES `";
$res = mysql_query("SHOW TABLES");
while ($row = mysql_fetch_array($res)) {
$tables .= $row[0].'`, `';
}
$tables = preg_replace('/,$/','', $tables);
$length = strlen($tables)-3;
$tables = substr($tables, 0, $length);
mysql_query($tables.";") or die("Error: ".mysql_error());
mysql_close();
exit();
?>
Any help is appreciated.
-Samuel
The email I get with the error is:
Error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
But since I know the basics on how to query a MySQL server for the data I need, I am asking for assistance.
Here is the script (originally written by HalfaBee):
<?
mysql_connect("mysql03.powweb.com","username","password") or die("Error: ".mysql_error());
mysql_select_db("database") or die("Error: ".mysql_error());
$tables = "OPTIMIZE TABLES `";
$res = mysql_query("SHOW TABLES");
while ($row = mysql_fetch_array($res)) {
$tables .= $row[0].'`, `';
}
$tables = preg_replace('/,$/','', $tables);
$length = strlen($tables)-3;
$tables = substr($tables, 0, $length);
mysql_query($tables.";") or die("Error: ".mysql_error());
mysql_close();
exit();
?>
Any help is appreciated.
-Samuel