我收到这个语法错误SQL语法错误
你在你的SQL语法错误; 检查对应 你的MySQL服务器版本使用附近的“降序”
从这个代码
$insert_status=mysql_query("INSERT INTO status(status, date) VALUES
('$status','$date')") or die (mysql_error());
$get_status= mysql_query("SELECT * FROM status WHERE id DESC")
or die (mysql_error());
while($row=mysql_fetch_array($get_status)){
$status=$row['status'];
$date=$row['date'];
}
MySQL版本是5.0.91社区
的 正确的语法手册我该如何解决这个小问题?在此先感谢
什么是'id'?你的表模式是什么样的? – 2011-04-02 00:10:25
嘿格雷格CREATE TABLE如果不存在'状态'( 'id' int(255)NOT NULL AUTO_INCREMENT, 'status' text NOT NULL, 'user' varchar(255)NOT NULL DEFAULT'', 'date' varchar(255)NOT NULL DEFAULT'', PRIMARY KEY('id') )ENGINE = MyISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT = 31; – 2011-04-02 00:10:59
这就像Facebook的基本外观一样Newsfeed,id是每个评论的id。 www.fightstar.org/test/wall.php – 2011-04-02 00:12:18