Click to See Complete Forum and Search --> : php and mysql related


pallabmondal123
03-19-2006, 10:43 AM
hi

i have two table name country,news.In news table one of the field is country.
In country field value inserted in serialize format and also any
user can select more than one country.


Table:country
-------

id name
-- ----
144 India
260 Afganisthan
265 USA
270 Pakistan


Table:news
----



id header news country_id
--- ------ ---- -----------
1 A1 n1 a:1:{i:0;s:3:"114";}
2 A2 n2 a:2:{i:0;s:3:"114";i:1;s:3:"270";}
3 A3 n3 a:1:{i:0;s:3:"260";}
4 A4 n4 a:1:{i:0;s:3:"114";}
5 A5 n5 a:1:{i:0;s:3:"265";}
6 A6 n6 a:1:{i:0;s:3:"114";}
7 A7 n7 a:1:{i:0;s:3:"114";}
8 A8 n8 a:1:{i:0;s:3:"114";}
9 A9 n9 a:1:{i:0;s:3:"114";}
10 A10 n10 a:1:{i:0;s:3:"114";}
11 A11 n11 a:1:{i:0;s:3:"114";}
12 A12 n12 a:1:{i:0;s:3:"114";}




Now i want to select header and news whose country
name is India and also i want to apply paging concept in the same
select query.


pallab.

chazzy
03-19-2006, 01:06 PM
You need to redesign your table. If the country_id can have multiple values, it should be its own table. You can't do searches with it formatted like this.