![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Jun 2005
Location: Queensland
Posts: 37
Rep Power: 0
![]() |
Multiple Condition Where Clause
ive made a database and php script to access and search my songlists. my php code to select items from the DB looks like this:
$query = "SELECT * FROM tracks WHERE artist like '%$artist%' AND track like '%$songname%' AND genre like '%genre%'"; everything works perfectly smoothly exept the AND [genre like '%genre%'";] part. to me it seems that and can't be used twice in a row as track works correctly with it. whats the correct way of 'selecting' 3 or more items [WHERE] in a query? thanks alot |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Jun 2005
Location: Queensland
Posts: 37
Rep Power: 0
![]() |
ah damnit, nobody bother replying to this. solved. i didn't use genre as a variable.
'%$genre%' |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|