This one has been kicking me for the last couple of days... and it's starting to tick me off... I've got some queries that I need to run via PHP against a mySQL database. For the most part, the queries work OK... the only time they don't seem to want to is when there are special characters in the search string.
I've got it printing out the sql, and when I then copy that sql and use it in the mySQL Query Browser, it returns the correct results.
That's the code I'm using to call the query.... if I use "queen" .. as the $artistName, then I get back results correctly -- all albums by Queen. BUT, if I use "Queensrÿche" ... the results are empty... and I should get 1 result. I've also found this to happen if I'm searching for something with an ampersand in it too....Code:$SAMQuery = "SELECT songlist.artist, album, label, count(trackno) as trackcount, albumyear FROM songlist INNER JOIN categorylist ON songlist.ID = categorylist.songID INNER JOIN category ON categorylist.categoryID = category.ID WHERE (category.name = 'Current Tracks') AND (songlist.songtype='S') AND (songlist.artist = '".$artistName."') GROUP BY songlist.artist, album, label, albumyear ORDER BY album"; $SAMdb->open($SAMQuery);
Is there something I'm missing?
If you want to see it in action try this link ... you'll get the resutls for a search on "queen" ... there's two links, one for Queen that returns results, and one for Queensrÿche that claims to return no results (should return 1).
-tg




Reply With Quote