I have the below query which limits users from submitting a form more than once per day. How could I write this SQL/SELECT statement in a secure way in my php code (to protect from injection, etc)? Below includes the SQL select statement that phpMyAdmin output as php:
$email = $data["email"];
$result = $this->_db->QuickArray(
"SELECT count(*) AS ct\n"
"WHERE email =\'$email\'\n"
"AND submitdate >= curDate() \n"
"AND submitdate < DATE_ADD(curDate(), INTERVAL 1 DAY)";
$foundSomething = $result;
Do I have to include something with "mysql_real_escape_string" for security ?
What is the \n for ?