Page 1 of 1

select with string condition display problem

Posted: Wed Dec 25, 2002 10:03 pm
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?

Posted: Wed Dec 25, 2002 10:22 pm
by evilcoder
Not quite understanding what you mean?

Posted: Wed Dec 25, 2002 10:41 pm
by hob_goblin
try

Code: Select all

SELECT * FROM cards WHERE card_name LIKE 'xmas'
you will need the quotes around the string

Posted: Wed Dec 25, 2002 11:29 pm
by keymistress
argh!!! it was simple as that! the damn quotes!
thanks hob_goblin!