sql中写入变量的几种写法:

1:使用单引号包括双引号拼PHP变量'" .$name . "'

$sql = "select ci_goods.name,ci_order_info.description from ci_goods left join 
ci_order_info on ci_goods.id = ci_order_info.invId 
where ci_order_info.description !='' and ci_order_info.tax ='0' and
 ci_goods.name like '%".$checkused."%'";

2:单引号大括号:

 $sql = "update message set mloop=1 where sender='{$geter}' and geter='{$sender}' and mloop=0";

你可能感兴趣的:(sql中写入变量的几种写法:)