PDA

View Full Version : Php Formatting Help


cactuswings
02-18-2002, 02:22 AM
Hello, I have a PHP/SQL realted question. I am brand new to PHP and managed to get a query on a SQL database to work using PHP. My query returns the results correctly however the results are not formatted correctly. You can go to http://www.cactuswings.com/actest.htm and just press "submit" to see what i am talking about. I have also placed the PHP code below, maybe that can help you determine what I have done wrong.


<html>
<body>
<body bgcolor="#000080">

<p><font size="1" face="Verdana" color="#FFFF00">


<?php
$dbh=mysql_connect ("localhost", "cactusw_jpi", "<PASSWORD>") or die ('I cannot connect to the database.');
mysql_select_db ("cactusw_ac");


if ($REG == " ")
{$REG = '%';}


$result = mysql_query ("SELECT * FROM ACRZ
WHERE REG LIKE '$REG%'
");

if ($row = mysql_fetch_array($result)) {

do {
echo $row["REG"], "&nbsp;&nbsp;&nbsp;&nbsp;",$row["AIRCRAFT"],"&nbsp;&nbsp;&nbsp;&nbsp;",$row["DATE"], "&nbsp;&nbsp;&nbsp;&nbsp;",$row["FLT"], "&nbsp;&nbsp;&nbsp;&nbsp;",$row["CTYPAIR"], "&nbsp;&nbsp;&nbsp;&nbsp;",$row["BASE"], "<p>";

} while($row = mysql_fetch_array($result));

} else {print "Sorry, no records were found!";}

?>

</body>
</html>

Thanks for your help!

Jeremy