Come on Guys and Girls!
I’ve worked out the ‘while loop’ for numbers, it’s quite easy (when you know how).
Being 42 (in 2 weeks) my brain is a little slow, and getting slower, (age).
You can tell i’ve been working hard because i’m using a lot of brackets.
Where am I going wrong?
The code below comes from 5 distinct links of cities, birmingham, glasgow, london ...
When I click the link such as ‘birmingham’ I arrive at a page where everything related to ‘birmingham’ should be displayed, and so to for the other cities. However only one record is being displayed when I know there are 3 records of each city.
I’ve figured the ‘loop’ for numbers, but to get pacific related data i’m a little stumped.
Guidance to any tutorials or direction appreciated, but no shouting since i’m simply learning.
Thanks, Stuart.
Laid out this way for easy reading.
$id = mysql_real_escape_string(trim($_GET['id']));
$data = mysql_query("SELECT location FROM cities WHERE id = '$id' ")
or die(mysql_error());
$info = mysql_fetch_array( $data );
While ???
{
Print "".$info['location'] ."";
}