Hello,
In my site, I have a small database which stores emails. I am trying to retrieve data such as Inbox email count, Spam email count, Trash email count etc.
I have no idea why I am getting this MYSQL 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 'to = 'youremail@gmail.com' AND type = 'inbox'' at line 1
$mysql = "SELECT * FROM email WHERE to = '$email' AND type = 'inbox'";
$result = mysql_query($mysql) or die(mysql_error());
$totalNumberOfEmail = mysql_num_rows($result);
Is the error due to the fact that my database is empty? If it is so, then how do i by pass this error. Do I have to enter dummy email in my database to get read of this error?
Any help will be appreciated.
Thank you