💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
1.在冲突的字段加上转移符,这样子就可以了: ~~~ insert into test_table (wind_code,name,`read`,creade_time) values (?,?,?,?) insert into `user` (wind_code,name,`read`,creade_time) values (?,?,?,?) ~~~ (注意:这个转移符不是中文(‘)或者英文(')的单引号,而是这个(`),长得很像对不对?如果用单引号,还是会报错,之前不知道,被坑了几次) 2.使用变量 ~~~ SQLstr = “select * from abc_table where user _name= ‘abc’” ; 假设查询条件中使用的是变量,例如: $user_name = $_REQUEST['user_name']; //字符串变量 或 $user=array (”name”=> $_REQUEST['user_name‘,"age"=>$_REQUEST['age'];//数组变量 } 需要改成 SQLstr=”select * from abc_table where user_name =’ ” . $user _name . ” ‘ “; SQLstr=”select * from abc_table where user_name =’ ” . $user["name"] . ” ‘ “; ~~~ ” ” 双引号里面的字段会经过编译器解释,然后再当作HTML代码输出。 ‘ ‘ 单引号里面的不进行解释,直接输出。