<?php
?>
<?php
include("08MySQL.php");
//创建mysql对象
$mysql = new MySQL("localhost","root","123456","think_frank","gbk");
//添加
$addSQL = "insert into think_blog(title,content) values('08网络','马上毕业了')";
$mysql->myUpdate($addSQL);
//删除
//$delSQL = "delete from
//$result = $mysql->myUpdate($delSQL);
//echo $result;
//修改
//$upSQL = "update think_blog set title='网络信息' ,content='呃呃呃呃呃呃' where id=24";
//$r = $mysql->myUpdate($upSQL);
//echo $r;
//查询单条记录
$sql="select * from think_blog where id=16";
$res = $mysql->myUpdate($sql);
//需要对结果做遍历
if($row = $mysql->myFetch($res)){
}
查询所有记录
$allSQL = "select * from think_blog";
$resall = $mysql->myUpdate($allSQL);
while($row = $mysql->myFetch($resall)){
}
?>