Number of columns does not matter! 
But you need to know your database table field names what you want to display in certain columns of a html table. Here is the php code:
[php]<?php
// connecting to MySQL database
$mysqlink = mysql_connect(‘localhost’,‘UserName’,‘PaSSwoRd’) or die(mysql_error());
mysql_select_db(‘dbName’,$mysqlink);
// query records from table
$r = mysql_query(“select Field1, Field2, Field3 from myTable order by Field1”);
if(mysql_num_rows($r)){
echo '<table width="100%" border="1">';
echo '<tr>';
echo '<th>Column 1</th>';
echo '<th>Column 2</th>';
echo '</tr>';
// display table records in a loop
for($i=0;$i<mysql_num_rows($r);$i++){
$f = mysql_fetch_array($r);
echo '<tr>';
echo '<td>'.htmlspecialchars($f['Field1']).'</td>';
echo '<td>'.htmlspecialchars($f['Field2']).'</td>';
echo '</tr>';
}
echo '</table>';
}
?>[/php]