select with string condition display problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
keymistress
Forum Newbie
Posts: 3
Joined: Wed Dec 25, 2002 10:03 pm
Location: singapore

select with string condition display problem

Post by keymistress »

hi
i have a SELECT * FROM cards WHERE card_name LIKE xmas
this query is fine and working
however when i try to to mysql_fetch_array for this query, i get an error
this does not happen when card_name LIKE xmas is an integer card_id = 1 rather than a text
does anyone know how i may still output the results of a query which uses a text as condition?
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

Not quite understanding what you mean?
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

try

Code: Select all

SELECT * FROM cards WHERE card_name LIKE 'xmas'
you will need the quotes around the string
keymistress
Forum Newbie
Posts: 3
Joined: Wed Dec 25, 2002 10:03 pm
Location: singapore

Post by keymistress »

argh!!! it was simple as that! the damn quotes!
thanks hob_goblin!
Post Reply