Ai
1 Star 1 Fork 0

TING/Ting-PHP-CRUD

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
demo2.php 1012 Bytes
一键复制 编辑 原始数据 按行查看 历史
TING 提交于 2020-11-26 19:42 +08:00 . first commit
<?php
require './MsPDO.class.php'; //手动加载类文件
//测试
$param=array(
);
$mspdo= MsPDO::getInstance($param);
//echo $mypdo->exec('delete from news where id=6');
/*
if($mypdo->exec("insert into news values (null,'11','1111',unix_timestamp())"))
echo '自动增长的编号是:'.$mypdo->lastInsertId ();
*/
$list=$mspdo->fetchAll('select * from test');
//$list=$mspdo->fetchRow('select * from test1');
echo '<pre>';
//var_dump($list);
echo '<table border="1" width="600" align="center">';
echo '<tr bgcolor="#dddddd">';
echo '<th>编号</th><th>书名</th><th>公司</th><th>地区</th><th>电话</th><th>EMALL</th>';
echo '</tr>';
foreach ($list as $key=>$value)
{
echo '<tr>';
//foreach里面嵌套一个for循环也是可以的
/*for($n=0;$n<count($value);$n++)
{
echo "<td>$value[$n]</td>";
}*/
//foreach里面嵌套foreach
foreach($value as $k=>$v)
{
echo "<td>{$k}-{$v}</td>";
}
echo '</tr>';
}
echo '</table>';
var_dump($list);
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/ting-code/Ting-PHP-CRUD.git
git@gitee.com:ting-code/Ting-PHP-CRUD.git
ting-code
Ting-PHP-CRUD
Ting-PHP-CRUD
main

搜索帮助