21,882
社区成员
发帖
与我相关
我的任务
分享
mysql>update `1001` set finish=0 where sid=94664;
Query OK,1 row affected (0.07 sec)
Rows matched:1 changed:1 warnings:0
$tid="`".$_COOKIE['uid']."`";
$which="finish=1";
$where="sid=".$sid;
$db=new Mysql("localhost","root","","members_check","","UTF8");
$db->connect();
$result=$db->update($tid,$which,$where);
echo $result;
//if($result){echo 0;}else{echo 1;}
public function query($sql) {
if ($sql == "") {
echo "SQL语句为空";
}
$this->sql = $sql;
$result = mysql_query($this->sql, $this->conn) or die('faill'.mysql_error());
$this->result = $result;
return $this->result;
}
public function update($table, $mod_content, $condition, $url = '') {
$result=$this->query("UPDATE $table SET $mod_content WHERE $condition");
return $result;
}
<?php
include_once './check.php';
$cid=77777778;
$sid=94664;
$tid=1001;
$tid="`".$tid."`";
$which="finish=1";
$where="sid="."$sid"." and cid="."$cid";
$db=new Mysql("localhost","root","","members_check","","UTF8");
$db->connect();
$result=$db->update($tid,$which,$where);
var_dump($result);
?>
<pre class='xdebug-var-dump' dir='ltr'><font color='#3465a4'>null</font></pre>
<pre class='xdebug-var-dump' dir='ltr'>
<small>string</small>
<font color='#cc0000'></font>
<i>(length=0)</i>
</pre>