Hey all,
i have a mysql query which works fine and pulls the corrcet data it just when i try and print it to a single or essentially (a dynamic text field in flash) which i have done before but for some reason it’s not working this time round.
I have 3 results in the database under the field suburb and i want all 3 of these results to appear on the one line/ in the one dynamic textfield on one line.
ATM i only get one suburb showing instead of three?
My take on it i think i’m missing a loop or something?
Maybe a fresh set of eyes will help???
Here is the code below:
<?php
$suburbs = $_POST['suburbs_vars'];
mysql_pconnect("$server", "$user", "$pass") or die (mysql_error());
mysql_select_db("$database") or die (mysql_error());
$sql = "SELECT suburb FROM `mytable` ORDER BY `suburb` ASC";
$result = mysql_query( $sql );
while ($line = mysql_fetch_array($result)) {
printf("Suburb: %s", $line[0]);
$ourtext = "suburbs_vars=" . $line['suburb'];
}
print($ourtext);
mysql_free_result($result);
?>