I’m trying to truncate the table named ‘comments’ Yet every time I run the script nothing happens. What is wrong with my syntax?
<?php
$con = mysql_connect("localhost","user","pass");
if (!$con)
mysql_select_db("dbname", $con);
mysql_query("TRUNCATE TABLE 'comments'");
mysql_close($con);
?>
The quotes, try changing it to:
This will also tell you what goes wrong.