Jump to content

MySQL SELECT Query Question


phporcaffeine

Recommended Posts

[!--quoteo(post=369245:date=Apr 27 2006, 09:40 AM:name=phpORcaffine)--][div class=\'quotetop\']QUOTE(phpORcaffine @ Apr 27 2006, 09:40 AM) [snapback]369245[/snapback][/div][div class=\'quotemain\'][!--quotec--]
What's the 'proper' syntax for multiple WHERE conditions?

1.) SELECT * FROM table WHERE col_1 = 'val_1' AND col_2 = 'val_2' ?

2.) SELECT * FROM table WHERE col=1 = 'val_1', col_2='val_2' ?
[/quote]


The first expression is the right one:
SELECT * FROM table WHERE col_1 = 'val_1' AND col_2 = 'val_2' ;
[!--quoteo(post=369254:date=Apr 27 2006, 11:08 AM:name=phpORcaffine)--][div class=\'quotetop\']QUOTE(phpORcaffine @ Apr 27 2006, 11:08 AM) [snapback]369254[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Yeah, I got it ....

I was going nuts I couldn't get why my query was bombing? Then I noticed I had 'AND' in the query as 'ADN'
BIG DIFFERENCE when you can spell, LMAO
[/quote]
maybe its the lack of caffine

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.