Jump to content


Photo

simple error, can't figure it out


  • Please log in to reply
1 reply to this topic

#1 curtis_b

curtis_b
  • Members
  • PipPipPip
  • Advanced Member
  • 48 posts

Posted 01 March 2006 - 10:19 PM

Here's the error I'm getting:

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 'Group = 'KK'' at line 1

The variable $group is being stored in the url as a link from a previous page:
[a href=\"http://ecolab.7cpco.com/pricegroups.php?group=KK\" target=\"_blank\"]http://ecolab.7cpco.com/pricegroups.php?group=KK[/a]

Here's the php code that's causing the error:
$query = "SELECT * FROM item_list_price_groups where Group = '$group'";


I have other pages that work just the same as this is intended to (result based on url-stored variable). I pretty much copied the code verbatim from another application I wrote that works fine. I don't understand what could be wrong with this query. Thanks for your help.






#2 Boerke

Boerke
  • Members
  • Pip
  • Newbie
  • 8 posts

Posted 02 March 2006 - 12:00 AM

[!--quoteo(post=350810:date=Mar 1 2006, 11:19 PM:name=curtis_b)--][div class=\'quotetop\']QUOTE(curtis_b @ Mar 1 2006, 11:19 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Here's the error I'm getting:

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 'Group = 'KK'' at line 1

The variable $group is being stored in the url as a link from a previous page:
[a href=\"http://ecolab.7cpco.com/pricegroups.php?group=KK\" target=\"_blank\"]http://ecolab.7cpco.com/pricegroups.php?group=KK[/a]

Here's the php code that's causing the error:
$query = "SELECT * FROM item_list_price_groups where Group = '$group'";
I have other pages that work just the same as this is intended to (result based on url-stored variable). I pretty much copied the code verbatim from another application I wrote that works fine. I don't understand what could be wrong with this query. Thanks for your help.
[/quote]

$sql = mysql_query("SELECT * FROM item_list_price_groups WHERE Group = '$group'");




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users