Colin-Roberts
10-03-2007, 09:30 PM
anyone find errors?
<?php
include 'config.php';
$query = "SELECT name, lname, age, color, friend, pet, sib, ftown, htown, stat, sex, gr, school FROM profile";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "First Name:{$row['name']} <br>" .
"Last Name: {$row['lname']} <br>" .
"Age:{$row['age']} <br>" .
"Status: {$row['stat']} <br>" .
"Grade:{$row['gr']} <br>" .
"School: {$row['school']} <br>" .
"Gender:{$row['sex']} <br>" .
"Fav Town: {$row['ftown']} <br>" .
"Hometown:{$row['htown']} <br>" .
"Fav Color: {$row['color']} <br>" .
"Best Friend(s):{$row['friend']} <br>" .
"Pets: {$row['pets']} <br>" .
"Siblings: {$row['sib']} <br><br>";
}
?>
it works fine like this:
$query = "SELECT name, lname , age, stat, sex, gr, ftown, htown, sib FROM profile";
$result = mysql_query($query);but when i add the rest it doenst?
Edited by Lµke (Forum Moderator): Thread Moved From Website Designing. Please post in the correct section next time, Thanks :).
<?php
include 'config.php';
$query = "SELECT name, lname, age, color, friend, pet, sib, ftown, htown, stat, sex, gr, school FROM profile";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "First Name:{$row['name']} <br>" .
"Last Name: {$row['lname']} <br>" .
"Age:{$row['age']} <br>" .
"Status: {$row['stat']} <br>" .
"Grade:{$row['gr']} <br>" .
"School: {$row['school']} <br>" .
"Gender:{$row['sex']} <br>" .
"Fav Town: {$row['ftown']} <br>" .
"Hometown:{$row['htown']} <br>" .
"Fav Color: {$row['color']} <br>" .
"Best Friend(s):{$row['friend']} <br>" .
"Pets: {$row['pets']} <br>" .
"Siblings: {$row['sib']} <br><br>";
}
?>
it works fine like this:
$query = "SELECT name, lname , age, stat, sex, gr, ftown, htown, sib FROM profile";
$result = mysql_query($query);but when i add the rest it doenst?
Edited by Lµke (Forum Moderator): Thread Moved From Website Designing. Please post in the correct section next time, Thanks :).