02-17-2009, 07:06 PM
|
#2 (permalink)
|
|
The Contributor
Join Date: Feb 2009
Posts: 65
Thanks: 0
|
Well you have not defined "$BusinessName" or "$BusinessStreet". If you leave the code unchanged you would need to use $row[0], $row[1], ect.
Or you could use "list" or "foreach" to make variables with those names.
PHP Code:
while ( $row = mysql_fetch_array($result) ) {
list ($BusinessName, $BusinessStreet) = $row;
}
PHP Code:
while ( $row = mysql_fetch_array($result) ) {
foreach ($row as $key => $value) {
}
}
Also you need to have the data echoed inside the while or foreach loops. Else you will only get the last record that was returned.
PHP Code:
<?php
while ( $row = mysql_fetch_array($result) ) {
foreach ($row as $key => $value) {
?>
<input type=text name="BusinessName" value="<?PHP echo $BusinessName ?>"></br>
<input type=text name="BusinessStreet" value="<?PHP echo $BusinessStreet ?>">
<?php
}
}
?>
|
|
|
|