output problem

wxdqz

New Member
I created a simple table with mysql containing a cust_id and a cust_name.
I inserted 3 names and I am able to see them at the mysql prompt, but
when i run this script it does not output the data, but I can see that 3 rows
were selected. I know it's probably something simple i am missing, i just
don't see it. Any help would be mightly appreciated.
Thank You
<?
$db_name = "testDB";
$table_name = "customer";
$connection = mysql_connect("engineering","","") or die(mysql_error());
$db = mysql_select_db($db_name, $connection) or die(mysql_error());
$sql_list = "SELECT * FROM $table_name ORDER BY cust_id ASC";
$result = mysql_query($sql_list,$connection) or die(mysql_error());
$num = mysql_num_rows($result);
echo "This is the number of records $num<BR>";
while ($row = mysql_fetch_array($result));{
$cust_id = $row['cust_id'];
echo "$cust_id";
$cust_name = $row['cust_name'];
echo "$cust_name";
}
?>

<body>
<B>customer id: </B><?echo "$cust_id";?>&nbsp
<strong>Customer NAME: </strong><?echo "$cust_name";?><BR>
</body>
 
Back
Top