$sql="delete from cs_table where id='".$_GET[id]."'";
$dele=$msg->find_primary_key($sql);
print_r($dele); public function del($table,$id,$col="")
{
if(!$col)$col=$this->find_primary_key($table);
if (is_array($id))
{
$ids=implode(",",$id);
$sql="delete from `$table` where $col in (".$ids.")";
}else
{
$sql="delete from `$table` where $col=$id";
}
if(!$msg=$this->query($sql))
{
$this->err($sql);
}
return $msg;
} {foreach item=user from=$info }
<tr>
<td>{$user.name}</td>
<td colspan="8">{$user.address}</td>
<td colspan="2">{$user.sex}</td>
<td colspan="2"><div align="center"><a href="?id={$user.id}">修改</a></div></td>
<td><div align="center"><a href="?id={$dele.id}">删除</a></div></td>
</tr>
{/foreach}本人菜鸟 求救啊
$dele=$msg->find_primary_key($sql);
print_r($dele); public function del($table,$id,$col="")
{
if(!$col)$col=$this->find_primary_key($table);
if (is_array($id))
{
$ids=implode(",",$id);
$sql="delete from `$table` where $col in (".$ids.")";
}else
{
$sql="delete from `$table` where $col=$id";
}
if(!$msg=$this->query($sql))
{
$this->err($sql);
}
return $msg;
} {foreach item=user from=$info }
<tr>
<td>{$user.name}</td>
<td colspan="8">{$user.address}</td>
<td colspan="2">{$user.sex}</td>
<td colspan="2"><div align="center"><a href="?id={$user.id}">修改</a></div></td>
<td><div align="center"><a href="?id={$dele.id}">删除</a></div></td>
</tr>
{/foreach}本人菜鸟 求救啊
解决方案 »
- 怎么把按钮改为超连接形式??
- PHP正则表达式怎么匹配整单词
- 这样的JSON在PHP中如何使用?
- 为什么在不同的公司注册域名价格会有差别???
- 查询问题
- PHP数据传递问题
- 怎样做一个象csdn首页上面的日历?
- 问题:当运行一个计数器的程序时,出错!网页提示 : Call to undefined function: imagecreatefromgif() in <b>c:\apache\htdocs\cgi-bin\counter.php ……
- ------在线等,这句php上传如何重命名?
- 怎么把easyphp的项目放到阿里云服务器上
- 一个数组,后面加了个中括号,什么意思?
- $_GET=&$HTTP_GET_VARS
$dele=$msg->find_primary_key($sql);
$msg->find_primary_key($sql); 13行
你传过去的不是一个对象...
你能贴下你的find_primary_key方法吗?
{
if(!$col)$col=$this->find_primary_key($table);
if (is_array($id))
{
$ids=implode(",",$id);
$sql="delete from `$table` where $col in (".$ids.")";
}else
{
$sql="delete from `$table` where $col=$id";
}
if(!$msg=$this->query($sql))
{
$this->err($sql);
}
return $msg;
}