Jump to content


Photo

FROM entire_catalog WHERE artist=dysrhythmia


  • Please log in to reply
4 replies to this topic

#1 RickChase

RickChase
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 20 March 2003 - 09:55 PM

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

#2 RickChase

RickChase
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 20 March 2003 - 10:25 PM

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

#3 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 20 March 2003 - 10:27 PM

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

Hope this helps!
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#4 RickChase

RickChase
  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 20 March 2003 - 10:55 PM

Hope this helps!


Outstanding!! Thank you very much!
Rick

#5 holiks

holiks
  • Members
  • PipPipPip
  • Advanced Member
  • 83 posts

Posted 21 March 2003 - 04:42 AM

hehe...them damn little quotes .. :D
__________________________________________________________[br]$php = array('..a stack', '...once you pop', '...you don't stop');




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users