Jump to content

FROM entire_catalog WHERE artist=dysrhythmia


RickChase

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

Link to comment
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.