本帖最后由 u010416883 于 2013-06-01 11:37:22 编辑
由解,以下疑问!<br />
public static function query($sql, $unbuffered = false) {<br />
$ret = self::$db->query($sql, $unbuffered);//该句成功时$ret为1 注::self::$db->query为mysql_query<br />
if ($unbuffered===true) {<br />
$cmd = trim(strtoupper(substr($sql, 0, strpos($sql, ' '))));<br />
if ($cmd === 'SELECT') { } <br />
elseif ($cmd === 'UPDATE' || $cmd === 'DELETE') {<br />
$ret = self::$db->affected_rows();<br />
} <br />
elseif ($cmd === 'INSERT') {<br />
$ret = self::$db->insert_id();//该处运行时证明执行了,返回的是int类型id号<br />
}<br />
}<br />
return $ret;//最终返回不是int类型id号<br />
} <br />