我需要使用一个在MySql中完美运行的查询。和查询是
SELECT * FROM c2cxdb.jobs where job_title like '%Java%' and job_policy = 'Public' and job_status = 1;
我需要将%%中的java替换为传递给方法的动态值。
function AllJobs($job_title){
$allJobs = DB:: select('select * FROM c2cxdb.jobs where job_title like '%$job_title%' and job_policy = "Public" and job_status = 1');
dd($allJobs);
}
但是当我运行它时会显示除零异常。如何用我的值替换我的查询中的值。我需要将$ job_title值转换为查询。
答案 0 :(得分:1)
function AllJobs($job_title){
$allJobs = DB:: select('select * FROM c2cxdb.jobs where job_title like "%'.$job_title.'%" and job_policy = "Public" and job_status = 1');
dd($allJobs);
}
答案 1 :(得分:0)
(function() {
var a = 2;
var c = {
a: 3,
say: function() {
console.log(this.a);
}.bind(this)
};
c.say();
})()