Home > Backend Development > PHP Tutorial > mysql字段插入代码

mysql字段插入代码

WBOY
Release: 2016-06-23 13:39:24
Original
1016 people have browsed it

想在数据库的body字段中插入一句 完整的代码:

array (29 => '1',)
Copy after login
php应该怎么写?


回复讨论(解决方案)

insert

$arr = array (29 => '1');$sqlstr = "insert into table(body) values('".json_encode($arr)."')";mysql_query($sqlstr) or die(mysql_error());
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template