hi guys i am a newbie at PHP. I have written a query to show the content of a table in MySQL. The ouput is correct but i would like it to look neater. I have tried using tables but i can only get it to display the first row in the table. This probably sounds simple to you guys but bear with me. If you can help please do so in detail. Thanks! The code is below:
<html>
<body>
<?php
$db_name="clarendon";
$table_name="merchandise";
$connection=@mysql_connect("localhost","root",""or die("connect fail"
$db=@mysql_select_db($db_name,$connection) or die("dbselect fail"
$sql="select stockno,description,size,qty,reorderqty,price,notes from
$table_name";
$result=@mysql_query($sql,$connection)or die("execute fails"
while ($row=@mysql_fetch_array($result)){
$stockno=$row['stockno'];
$description=$row['description'];
$size=$row['size'];
$qty=$row['qty'];
$reorderqty=$row['reorderqty'];
$price=$row['price'];
$notes=$row['notes'];
echo"<p>$stockno,$description,$size,$qty,$reorderqty,$price,$notes";
}
?>
<html>
<body>
<?php
$db_name="clarendon";
$table_name="merchandise";
$connection=@mysql_connect("localhost","root",""or die("connect fail"
$db=@mysql_select_db($db_name,$connection) or die("dbselect fail"
$sql="select stockno,description,size,qty,reorderqty,price,notes from
$table_name";
$result=@mysql_query($sql,$connection)or die("execute fails"
while ($row=@mysql_fetch_array($result)){
$stockno=$row['stockno'];
$description=$row['description'];
$size=$row['size'];
$qty=$row['qty'];
$reorderqty=$row['reorderqty'];
$price=$row['price'];
$notes=$row['notes'];
echo"<p>$stockno,$description,$size,$qty,$reorderqty,$price,$notes";
}
?>