Friday, 15 April 2011

Mysql SET and querying subset with PHP -



Mysql SET and querying subset with PHP -

i have basic mysql database , using php web service android application. there 21 categories in app , storing them in column mysql set in database. article can have multiple categories.

i allow users take 1 or more categories. right sending selected categories hardcoed "string" value , concatenating of them follows.

select * ........... cats '%$cat1%' or cats '%$cat2%'

as can guess low process.

what right way this?

make categories table, article table, , union table foreign keys, locate article in multiple categories.

php mysql set

No comments:

Post a Comment