flyfllly 发表于 2010-5-5 14:09:57

$this->db->query问题

$this->db->query("select password from person where name =? ",$_POST["name"]);
这样的语法错吗?

下面是我显示的错误:
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
select password from person where name =

Hex 发表于 2010-5-5 14:19:49

请仔细看手册:
$sql = "SELECT * FROM some_table WHERE id = ? AND status = ? AND author = ?";
$this->db->query($sql, array(3, 'live', 'Rick'));

你看看你的和手册例子一样吗?

http://codeigniter.org.cn/user_guide/database/queries.html
页: [1]
查看完整版本: $this->db->query问题