SQL语句记录

来源:互联网 发布:java数组倒置 编辑:程序博客网 时间:2024/06/06 09:47

   前几天用C#写一个窗体程序,SQL语句出现问题记录下来吧。


C#SQL插入语句示例:   string str="insert into [user]([ID],[username],[password])     values(25,'"+name+"','"+password+"')";


前面写过PHP的SQL语句也出现过问题趁现在记得找 出来记录下:


插入语句:

 $sql="insert into ".$section." values ('null','null','$name','$sex',$age,'$address','$history','','','$hospital','$type',now())";

查询语句:


 $sql="select * from ".$section." where name='$name'";