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

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

WBOY
WBOYOriginal
2016-06-13 11:17:55886browse

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

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
















------解决方案--------------------
$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 />}
Statement:
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