Re: Display results on html page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You appear to have a ton of extra braces. I've modified your code below. That should do it, though keep in mind that your HTML is faulty too, though most browsers will probably tolerate it. :)

--Dave

Michelle Whelan wrote:

I am looking to display results of a query inside of an html table. When I tested to see if this was correct it returned with a blank page on my website.

Here is my code:

TIA

Michelle

/* If there was a problem with the query... */
if (!$result || @mysql_num_rows($result) < 1)
{
print("No entries in table $table.");
exit;
}
print("<h3><strong>RESULTS FOR:'$ZipCode'</strong></h3>");
print('<table width="300" border="1">');
/* For each table entry returned... */
while($row = mysql_fetch_array($result))
{
print("<tr>");
print("<td width='25'>&nbsp;</td>");
//}
//{ print("<tr>");
print("<td width='75'><strong>Dirt Type:</strong></td>");
print("<td>" . $row['havedirtype'] . "</td>"); print("<td colspan="3">&nbsp;</td>");
//} //{
print("<tr>");
print("<td width="75"><strong>Yards:</strong></td>");
print("<td>" . $row['noyards'] . "</td>");
print("<td colspan="3">&nbsp;</td>");
//}
//{
print("<tr>");
print("<td width="75">Contact:</font></strong></td>");
print("<td>" . $row['contactname'] . "</td>");
print("<td colspan="3">&nbsp;</td>");
//}
//{
print("<tr>");
print("<td width="75"><strong>Phone #:</strong></td>");
print("<td>" . $row['areacode'] . "</td>");
print("<td>&nbsp;</td>");
print("<td>" . $row['prefix'] . "</td>");
print("<td>&nbsp;</td>");
print("<td>" . $row['suffix'] . "</td>");
print("<td>&nbsp;</td>");
//}
//{
print("<tr>");
print("<td width="25">&nbsp;</td>");
print("<td width="75"><strong>Zip Code:</strong></td>");
print("<td>" . $row['zipcode'] . "</td>");
print("<td colspan="3">&nbsp;</td>");
//}
//{
print("<tr>");
print("<td width="25">&nbsp;</td>");
print("<td width="75"><strong>Exp. Date:</strong></td>");
print("<td>" . $row['date_month'] . "</td>");
print("<td>&nbsp;</td>");
print("<td>" . $row['date_day'] . "</td>");
print("<td>&nbsp;</td>");
print("<td>" . $row['date_year'] . "</td>");
print("<td>&nbsp;</td>");
//}
//{
print("<tr>");
print("<td colspan="5">&nbsp;</td>");
//}
//{
print("<tr>"); print("<td width="25">&nbsp;</td>");
print("<td width="75"><strong>Email:</strong></td>");
print("<td colspan="3">&nbsp;</td>");
print("<td>" . $row['email'] . "</td>");
//}
//{
print("<tr>");
print("<td width="25">&nbsp;</td>");
print("<td width="75"><strong>Job City:</strong></td>");
print("<td colspan="3">&nbsp;</td>");
print("<td>" . $row['jobcity'] . "</td>");
//}
//{
print("<tr>");
print("<td width="25">&nbsp;</td>");
print("<td width="75"><strong>X-Streets:</strong></td>");
print("<td colspan="3">&nbsp;</td>")
print("<td>" . $row['xstreets'] . "</td>");
//}
//{
print("<tr>");
print("<td colspan="5">&nbsp;</td>");
}


print("</table>");






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux