Home > Backend Development > PHP Tutorial > 如何插入数据库,初学者求代码

如何插入数据库,初学者求代码

WBOY
Release: 2016-06-13 11:17:55
Original
893 people have browsed it

怎么插入数据库,菜鸟求代码,

求一下数据插入数据库的代码,求详解,谢谢
















------解决方案--------------------
$names=$_POST['name'];<br />$danweis=$_POST['danwei'];<br />$shus=$_POST['shu'];<br />for($i=0;$i<count($names);$i++){<br />      $sql="insert into tt(name,danwei,shu) values('$names[$i]','$danweis[$i]','$shus[$i]')";<br />	  mysql_query($sql);<br />}
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