PHP Splitting data from Database
Posted: Thu Sep 12, 2013 9:56 pm
just wanted to know if there was a way of splitting data from your MYSQL tables for example i have a table with cities names e.g:
ID City Name Attraction Population(in mill) Landmarks Economy
1 London 20 8.2 Trafalgar Square £30,000+
2 Cardiff 15 0.3 Millennium Stadium £30.000-
3 Liverpool 14 0.4 Royal Liver Building £15.000+
and i retrieve the info with simple:
now what i also have individual data for each city such as attraction and i want to put these in a table with there own individual data not by using the ID of the City as this table and city names will be assigned randomly based on the players overall data:
City Name Attraction Population(in mill) Landmarks Economy
London 20 8.2 Trafalgar Square £30,000+
Cardiff 15 0.3 Millennium Stadium £30.000-
Liverpool 14 0.4 Royal Liver Building £15.000+
sorry if i have not described this well and i hope that this is possible
ID City Name Attraction Population(in mill) Landmarks Economy
1 London 20 8.2 Trafalgar Square £30,000+
2 Cardiff 15 0.3 Millennium Stadium £30.000-
3 Liverpool 14 0.4 Royal Liver Building £15.000+
and i retrieve the info with simple:
Code: Select all
$invinfo="SELECT * from Cities where attraction <= '$playerinfo3[Overall]'";
$invinfo2=mysql_query($invinfo) or die("could not get opponent stats!");
$invinfo3=mysql_fetch_array($invinfo2
City Name Attraction Population(in mill) Landmarks Economy
London 20 8.2 Trafalgar Square £30,000+
Cardiff 15 0.3 Millennium Stadium £30.000-
Liverpool 14 0.4 Royal Liver Building £15.000+
sorry if i have not described this well and i hope that this is possible