...

View Full Version : MySQL Query (Fantastic?



Midgard
03-30-2007, 10:10 AM
Hi, i have this record(s) on my tablocuk table:



id | title | detail_ids
-----------------------------------------------------
2 | Test | 1, 11, 7, 19
3 | Test 2 | 8, 11, 19, 22


I'm using this query:

SELECT * FROM `tablocuk`WHERE `detail_ids` IN ('1', '11');

And I can't get any reply from MySQL?

Why? Please help me

Thanks,
-Mid

NancyJ
03-30-2007, 01:39 PM
well looking at the data you've supplied - if your table really looks like that, there are no matching results.
your detail_ids field contains '1, 11, 7, 19' and '8, 11, 19, 22', you're looking for that field to be '1' or '11' - which it never is.
A string is a string, and while I may be able to see what you're trying to do, mysql is not that smart - it does not know that the string in detail_ids is a set of comma separated values. Try normalising your data tables

...also, this is a mysql question and this is the php forum



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum