Hello,
Im a newbiew and need help with this php scirpt to optimize zen cart tables.

This is the php scirpt:
<?
// Change vars as needed here
$server = "localhost";
$username = "mysql_user";
$pwd = "mysql_password";
$dbName = "mysql_dbName";

$link = mysql_connect($server, $username, $pwd);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db($dbName, $link);
if (!$db_selected) {
die ('Can\'t use $dbName : ' . mysql_error());
}
// Find all tables in the selected DB
$alltables = mysql_query("SHOW TABLES");
// Process all tables.
while ($table = mysql_fetch_assoc($alltables))
{
foreach ($table as $db => $tablename)
{
// Optimize them!
mysql_query("OPTIMIZE TABLE '".$tablename."'")
or die(mysql_error());
}
}
mysql_close($link);
?>
I ran it on my server at get this 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 ''address_book'' at line 1
-----------------
Can Any one help me with this syntax error?
thanks,