Output to 2 columns
//you need this - it tells the data what collumn to go to
$count = 1;
$column = 1;
//db connect and select
$link = mysql_connect( "localhost", "root", "password" );
mysql_select_db( "dbname" );
$result=mysql_query ("select * from table_name");
//loop statement
while ($myrow = mysql_fetch_array ($result))
{
// this is the column 1
if ($column == 1)
{
printf("$count%s ",$myrow[value]);
}
else{
//this is the column 2
printf("$count%s ",$myrow[value]);
}
//increment the count
$count += 1;
// this is a modulus operator it gets the remainder of the equation
$column = $count % 2;
}
?>