MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 8th, 2007, 01:18 AM
phpretard phpretard is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 1 phpretard User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 53 sec
Reputation Power: 0
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>

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > 3 in 1 error special tonight


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT