siric Posted December 3, 2009 Share Posted December 3, 2009 Hi, I am inserting temporary values into a table for use on a resultset. Once I am done I want to clear the data out of the table and have used both //clear tempbiz table $sqlClearBiz = "DELETE from tempbiz"; $resClearBiz = mysql_query($sqlClearBiz); and //clear tempbiz table $sqlClearBiz = "TRUNCATE tempbiz"; $resClearBiz = mysql_query($sqlClearBiz); but neither work. However, I run the command in an SQl client, it works. What can I check?? Link to comment https://forums.phpfreaks.com/topic/183814-unable-to-clear-table/ Share on other sites More sharing options...
cags Posted December 3, 2009 Share Posted December 3, 2009 Try... $sqlClearBiz = "TRUNCATE tempbiz"; $resClearBiz = mysql_query($sqlClearBiz) or die(mysql_error()); To see if it is reporting an error with the request. Link to comment https://forums.phpfreaks.com/topic/183814-unable-to-clear-table/#findComment-970351 Share on other sites More sharing options...
fenway Posted December 4, 2009 Share Posted December 4, 2009 FYI, if you ever had any other records linked to this table by UID, you'd better clear them out, or reset the auto-increment value, or you'll be sorry. Link to comment https://forums.phpfreaks.com/topic/183814-unable-to-clear-table/#findComment-971246 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.