Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 28th, 2005, 4:06 AM   #1
foxcity911
Programmer
 
Join Date: Jun 2005
Location: Queensland
Posts: 37
Rep Power: 0 foxcity911 is on a distinguished road
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
foxcity911 is offline   Reply With Quote
Old Jul 28th, 2005, 4:42 AM   #2
foxcity911
Programmer
 
Join Date: Jun 2005
Location: Queensland
Posts: 37
Rep Power: 0 foxcity911 is on a distinguished road
ah damnit, nobody bother replying to this. solved. i didn't use genre as a variable.
'%$genre%'
foxcity911 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:10 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC