Below is the script that is closest to what I need to generate the MySQL results in 3 columns. That still did not work for me to do the test.
Generating error: Fatal error: Uncaught Error: Call to undefined function mysql_num_rows()
The error refers to this line: $num = ceil( mysql_num_rows( $query ) / $colunas );
Full Code:
<?php
$query=mysqli_query($con,"select categoria, link from categorias ORDER BY categoria ASC");
$colunas = 3;
$num = ceil( mysql_num_rows( $query ) / $colunas );//quantidade de registros por coluna
$li = '<ul class="coluna">';
$i = 0;
while( $dados = mysql_fetch_object( $query ) )
{
if( $i==$num )
{
$li .= '</ul><ul class="coluna">';
$i=0;
}
$li .= '<li>'.$dados->bairro.'</li>';
$i++;
}
$li .= '</ul>';
echo $li;
?>