jdowey Posted October 12, 2007 Share Posted October 12, 2007 for some reason I can not truncate my table, I am at a lost, can any one help me and tell me what I am doing wrong? this is my code. <?php $host="mysql"; $username="******"; $password="*******"; $database="webhistory"; $table="webhistory"; $connection = mysql_connect("$host", "$username", "$password") or die ("Unable to connect to server"); mysql_select_db("$database") or die ("Unable to select database"); $sql = "TRUNCATE TABLE `$table`"; mysql_query($sql); echo "Table Deleted"; mysql_close($connection); ?> Quote Link to comment https://forums.phpfreaks.com/topic/72971-mysql-truncate-table-in-php-just-will-not-work/ Share on other sites More sharing options...
fenway Posted October 15, 2007 Share Posted October 15, 2007 why not check mysql_error()? Quote Link to comment https://forums.phpfreaks.com/topic/72971-mysql-truncate-table-in-php-just-will-not-work/#findComment-369850 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.