I have a table that lists all employees in the database but when I deleted all of them using $query = mysql_query("DELETE FROM $this->emp_tbl");
I got this error:
Sucessfully deleted!Database Failed: 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 '-10,10' at line 1
As a test to see if the error will disappear, I tried adding a record via phpmyadmin instead & indeed this error disappears & it will now display 1 record.. How will I fix this error & still displays a "blank table instead" if no record is found?
Try this... object variable might not be parsing
mysql_query("DELETE FROM {$this->emp_tbl}");
Otherwise why can't you use Truncate
command?
mysql_query("TRUNCATE TABLE {$this->emp_tbl}");
I've got the same problem. I can't find any info about this case in official documentation but try:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.