php向表中插入数据

作者:fly 发布于:2014-2-1 17:36 分类:discuz

<?php  
 $con=mysql_connect("localhost","root","111");  
 if($con)  
  {  
      echo "连接成功!";  
  }  
  else  
  {  
    die('Could not connect: ' . mysql_error());  
  }   
   mysql_select_db("liyongquan_db", $con);  
   mysql_query("INSERT INTO Persons (FirstName, LastName, Age)   
   VALUES ('Peter', 'Griffin', '35')");  
   mysql_query("INSERT INTO Persons (FirstName, LastName, Age)   
   VALUES ('Glenn', 'Quagmire', '33')");  
   mysql_close($con);  
?>  



发表评论:

 
Powered by emlog sitemap