RickChase Posted March 20, 2003 Share Posted March 20, 2003 Hello, I have a record label and am setting up a database to hold all information relating to our releases. I have the following statement that works great (to list them by chronologically by release date): $sql="SELECT * FROM entire_catalog ORDER BY release_date_us"; Now, I want to just list releases by a certain artist (Dysrhythmia, in this case) and when I use this... $sql="SELECT * FROM entire_catalog WHERE artist=Dysrhythmia ORDER BY release_date_us"; I get the dreaded \"Warning: Supplied argument is not a valid MySQL result resource\" In my database, I have one table \"entire_catalog\" and in this table I have fields named \"artist\", \"title\", \"release_date_us\", \"release_date_eur\", etc... The \"artist\" field is setup as varchar(64) - why won\'t this work for me? In attempting to figure this out for myself, I changed the WHERE to pull only certain catalog numbers, and that worked great. But I cannot get it to pull only one artist by name. I have a feeling that it has something to do with the capitol \"D\" at the beginning of the name, but I need it to be there (in the \"artist\" field) so the name displays properly. Confused... Thank you for looking! Rick Quote Link to comment Share on other sites More sharing options...
RickChase Posted March 20, 2003 Author Share Posted March 20, 2003 Update - I added a new field (artist_id) and if I use WHERE artist_id=1 then it works great (lists all releases by that artist). But I would much rather use the bands name than have to try and remember everyones number. Thanks again, Rick Quote Link to comment Share on other sites More sharing options...
shivabharat Posted March 20, 2003 Share Posted March 20, 2003 $sql="SELECT * FROM entire_catalog WHERE artist=\'Dysrhythmia\' ORDER BY release_date_us"; Hope this helps! Quote Link to comment Share on other sites More sharing options...
RickChase Posted March 20, 2003 Author Share Posted March 20, 2003 Hope this helps! Outstanding!! Thank you very much! Rick Quote Link to comment Share on other sites More sharing options...
holiks Posted March 21, 2003 Share Posted March 21, 2003 hehe...them damn little quotes .. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.