Jump to content

Archived

This topic is now archived and is closed to further replies.

RickChase

FROM entire_catalog WHERE artist=dysrhythmia

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

$sql="SELECT * FROM entire_catalog WHERE artist=\'Dysrhythmia\' ORDER BY release_date_us";

 

Hope this helps!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.