php開發中sql語句拼接示例


 

666

 

1.插入語句

$sql="insert into Ad(AdClassID,AdType) values('".$AdClassID."','".$AdType."')";
 

 2.從數據庫中選出數據

$sql = "select * from AdClass order by ID desc";
$sql = "select * from admin where AdminID='".$_SESSION['AdminID']."'"; 3.更新數據庫中記錄數據 $sql="update Ad set AdClassID='".$AdClassID."' where ID='".$ID."'";
//查詢
$sql = "select * from comment where comment_id = ".$comment_fid;

或:        

$sql = "select * from comment where comment_id = '".$comment_fid."'";

//需要注意 這些引號問題
|

 

 

666


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM