|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
Help with a AND/OR b AND/OR c sql query
I inadvertantly posted this in the php forum so it's not really a repost
I need help with the following sql query: php Code:
That's the basics. What I really want to do is have a search on 3 keywords that will display an image based on those selections. If the user picks blue 1998 mustang I want to search: Each picture has 3 keywords: color, year and model. color = blue AND year = 1998 AND model = mustang If the user picks red 2002 viper then : color = red AND year = 2002 AND model = viper. It works fine if I only use: or year = $year, etc. If I use the AND it doesn't show anything. Also, if the user only picks two (like color and model) I want to include any year matching the color and model they've chosen. Any ideas would be greatly appreciated. Jeff |
|
#2
|
|||
|
|||
|
RE: Help with a AND/OR b AND/OR c sql query
It looks like your syntax is off on this:
WHERE color = $'color' Try WHERE color = '$color' good luck |
|
#3
|
|||
|
|||
|
RE: Help with a AND/OR b AND/OR c sql query
It looks like your syntax is off on this:
WHERE color = $'color' Try WHERE color = '$color' good luck |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Help with a AND/OR b AND/OR c sql query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|