Today, when writing a program, there's a problem: How to format data taken from a database by 2 columns per row
Show up. I think of an article I've seen here--"about the percent technique", which is not only very simple to solve
Problem, and also extend each row of 2 columns to n columns:
For example, $n is an integer
?>
......
$sql = "Select Id,subject from New";
Ora_parse ($cursor, $sql);
Ora_exec ($cursor);
$i = 0;
while (Ora_fetch ($cursor))
{
$i + +;
if ($i% $n ==1)
{
echo ""
echo "". Ora_getcolumn ($cursor, 1). "";
}
ElseIf ($i% $n ==0)
{
echo "". Ora_getcolumn ($cursor, 1). "";
echo "";
}
Else
echo "". Ora_getcolumn ($cursor, 1). "";
}
?>
......
http://www.bkjia.com/PHPjc/532009.html www.bkjia.com true http://www.bkjia.com/PHPjc/532009.html techarticle today, when writing a program, there is a problem: How to remove data from the database is displayed in 2 columns per row format. I think of an article I've seen here--"off ...