- 论坛徽章:
- 0
|
?php
/**
* @desc 表格N行N列
* */
$conn = mysql_connect('192.168.1.10','us','ps');
mysql_query("set names utf8");
$db = mysql_select_db('db');
$sql = "SELECT * FROM `users`";
$rs = mysql_query($sql, $conn);
while($row = mysql_fetch_assoc($rs)){
$arUsers[] = $row;
}
$users = array_chunk($arUsers, 3);
unset($arUsers);
?>
table border="1">
?php foreach($users as $row){ ?>
tr>
?php
foreach($row as $col){
echo "".$col['usID']."".$col['usName']."";
}
?>
/tr>
?php
}
?>
/table>
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/10599/showart_432146.html |
|