有时候在插入字符的时候,经常会发现',"很难插进去。在MYSQL里用就OK了。
举例如下:
mysql> create table new (name varchar(200));
Query OK, 0 rows affected (0.00 sec)
mysql> insert into new values('wt's test');
'>
'> ;
'> ';
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 's test');
;
'' at line 1
mysql> insert into new values('wt's test');
Query OK, 1 row affected (0.00 sec)
mysql>
mysql> insert into new values('wt"s test');
Query OK, 1 row affected (0.00 sec)
mysql> select * from new;
+-----------+
| name |
+-----------+
| wt's test |
| wt"s test |
+-----------+
2 rows in set (0.00 sec)[@more@]MySQL插入特殊字符