电弧烧伤后遗症:高手指教, PHP查询 mysql 出错

来源:百度文库 编辑:高考问答 时间:2024/05/12 15:43:16
已经连接
$sql="update site_news set title=$title,content=$content,ip='$ip' where id='$id'";
mysql_query($sql);
但是mysql_affected_rows()返回-1,是不是需要注意数据类型?还是什么原因?
写错了
$sql="update site_news set title='$title',content='$content',ip='$ip' where id='$id'";

数据库中title字段和content字段不是varchar类型么?内容赋值怎么没有引号?