表tb_note结构:
+---------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+----------------+
| note_id | int(11) | NO | PRI | NULL | auto_increment |
| note_user | varchar(20) | NO | | NULL | |
| note_title | varchar(40) | NO | | NULL | |
| note_content | varchar(500) | NO | | NULL | |
| note_mood | varchar(200) | NO | | NULL | |
| note_time | datetime | NO | | NULL | |
| note_user_pic | varchar(200) | NO | | NULL | |
| note_answer | int(1) | NO | | 0 | |
| note_flag | int(1) | NO | | 0 | |
+---------------+--------------+------+-----+---------+----------------+
sql语句:
insert into tb_note (note_user,note_title,note_content,note_mood,note_time,note_user_pic,note_flag) values(' 匿名','1234','qwert','<img src=‘images/face/1.gif’>',2012-09-11 10:29:35,'04.gif',0)
错误:
ERROR 1064 (42000): 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 'images/face/1.gif'>',2012-09-11 10:29:35,'04.
gif',0)' at line 1
求助错误原因!
+---------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+----------------+
| note_id | int(11) | NO | PRI | NULL | auto_increment |
| note_user | varchar(20) | NO | | NULL | |
| note_title | varchar(40) | NO | | NULL | |
| note_content | varchar(500) | NO | | NULL | |
| note_mood | varchar(200) | NO | | NULL | |
| note_time | datetime | NO | | NULL | |
| note_user_pic | varchar(200) | NO | | NULL | |
| note_answer | int(1) | NO | | 0 | |
| note_flag | int(1) | NO | | 0 | |
+---------------+--------------+------+-----+---------+----------------+
sql语句:
insert into tb_note (note_user,note_title,note_content,note_mood,note_time,note_user_pic,note_flag) values(' 匿名','1234','qwert','<img src=‘images/face/1.gif’>',2012-09-11 10:29:35,'04.gif',0)
错误:
ERROR 1064 (42000): 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 'images/face/1.gif'>',2012-09-11 10:29:35,'04.
gif',0)' at line 1
求助错误原因!
values(' 匿名','1234','qwert','<img src=\‘images/face/1.gif\’>',2012-09-11 10:29:35,'04.gif',0)
values('匿名','1234','qwert','<img src=''images/face/1.gif''>',2012-09-11 10:29:35,'04.gif',0);
insert into tb_note(note_user,note_title,note_content,note_mood,note_time,note_user_pic,note_flag) values(' 匿名','123','qwer','<img src=\'images/face/1.gif\'>',2012-09-11 14:57:33,'04.gif',0)换成这个语句后还是不对。
values('匿名','1234','qwert','<img src=''images/face/1.gif''>',2012-09-11 10:29:35,'04.gif',0);
'<img src="images/face/1.gif">'双引号引上图片的路径。
values('匿名','1234','qwert','<img src=''images/face/1.gif''>',2012-09-11 10:29:35,'04.gif',0);
双引号引上图片的路径。