SQL高级助手

1: 列出所有数据 select * from pi_data
2: 删除所有数据 delete from pi_data
3: 列出某一栏目数据 select * from pi_data where tid =(select tid from pi_type where tname = '频道1')
4: 删除某一栏目数据 delete from pi_data where tid =(select tid from pi_type where tname = '频道1')
5: 列出某一专题的数据 select * from pi_data where v_topic =(select id from pi_topic where name = '男人必看十部')
6: 删除 某一专题的数据 delete from pi_data where v_topic =(select id from pi_topic where name = '男人必看十部')
(请谨慎操作,以免造成数据错误![?])
ExecuteNoneQuery2($sql); if($num==-1) { echo '
'.$dsql->GetError().'
SQL执行失败,请检查SQL语句是否正确[?]
'; viewFoot(); exit(); } } echo '
SQL执行成功,'.$num.'条数据受影响
'; viewFoot(); exit(); } $dsql->SetQuery($sql); $dsql->Execute('sqlhelper'); $num = $dsql->GetTotalRow('sqlhelper'); if($num==0){ echo '
查询不到数据
'; viewFoot(); exit(); }if ($num%$pagesize) { $zongye=ceil($num/$pagesize); }elseif( $num%$pagesize==0){ $zongye=$num/$pagesize; } $moye=$zongye; $n = count($dsql->GetArray('sqlhelper')); $n = $n/2; $sql1 = $sql." limit $pagenum $pagesize"; $dsql->SetQuery($sql1); $dsql->Execute('sqlhelper2'); $row1=$dsql->GetOne(); foreach($row1 as $key=>$value){ if(is_string($key)){ ?> GetArray('sqlhelper2')){ ?>
 页次:/ 每页 总收录数据 首页 上一页 首页 上一页 =$zongye){ ?> 下一页 尾页 下一页 尾页