Hi guys, I cant figure out how to do the following.
My query returns 10 rows, and I want the layout to do the following.
Each row as 2 columns and then they are listed under one another. Just like the products are here:
http://www.yorkfitness.com/Treadmills-cat-501/Index.html
This is my code:
<?php
if (!($connection = @ mysql_pconnect($hostname,$username, $password)))
showerror();
if (!mysql_select_db($databaseName, $connection))
showerror();
$query = "SELECT n.name As News_Name FROM NEWS n";
if (!($result = @ mysql_query ($query, $connection)))
showerror();
// execute query
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
if (mysql_num_rows($result) > 0) {
}
else {
echo "No information for the home page set!";
}
while ($row = mysql_fetch_assoc($result)) {
?>
<? echo $row['News_Name']; ?>
<?
}
mysql_free_result($result);
// close connection
mysql_close($connection);
?>