|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
3 in 1 error special tonight
Can anuone see the problem here?
Warning: mysql_real_escape_string() expects parameter 2 to be resource, string given in /home/content/l/h/b/lhbrb/html/sendemail/sendemail.php on line 23 Warning: mysql_real_escape_string() expects parameter 2 to be resource, string given in /home/content/l/h/b/lhbrb/html/sendemail/sendemail.php on line 23 Warning: mysql_real_escape_string() expects parameter 2 to be resource, string given in /home/content/l/h/b/lhbrb/html/sendemail/sendemail.php on line 23 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 'WHERE yes IN ('instructional', 'tball', '\'rookie\'')' at line 1 $where = ''; if (!empty($_POST['cb']) && count($_POST['cb'])) { array_walk($_POST['cb'], 'mysql_real_escape_string'); $where = 'WHERE yes IN (\''. implode('\', \'', array_keys($_POST['cb'])).'\')'; } $query = "SELECT email FROM testemail . $where"; $result=mysql_query($query) or die(mysql_error()); <form action=page.php method=post> <input type=checkbox name="cb[instructional]"> <input type=checkbox name="cb[tball]"> <input type=checkbox name="cb['rookie']"> <input type=checkbox name="cb['minor']"> <input type=checkbox name="cb['major']"> <input type=checkbox name="cb['prep']"> </form> |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > 3 in 1 error special tonight |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|