Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用codeigniter将2个色谱柱合为一个_Php_Sql_Codeigniter - Fatal编程技术网

Php 使用codeigniter将2个色谱柱合为一个

Php 使用codeigniter将2个色谱柱合为一个,php,sql,codeigniter,Php,Sql,Codeigniter,我想在查询中将名字和姓氏连接为全名 $query = $this->db->select('CONCAT(w.firstName," ",w.lastName) as fullName,w.ID,w.firstName,w.lastName, w.firstname_ar, w.lastname_ar, w.cin , w.tel, w.tel2, w.poste_id, w.gender, w.date_birth, w.address, w.address_ar, w.famil

我想在查询中将名字和姓氏连接为全名

$query = $this->db->select('CONCAT(w.firstName," ",w.lastName) as fullName,w.ID,w.firstName,w.lastName, w.firstname_ar, w.lastname_ar, w.cin , w.tel, w.tel2, w.poste_id, w.gender, w.date_birth, w.address, w.address_ar, w.familySituation, w.socialSecurity, w.typeContract, w.period,w.email,w.status,r.name,w.conge as cng,w.startDateContract, w.pictureProfile, w.endDateContract, w.dateTitulation, w.rib, w.languages, w.passport, w.passport_end_date, w.urgent_phone, w.urgent_phone_name,w.pointage_id as idpointeur, w.shift_start as heure_arr, w.shift_end as heure_dep, w.worker_role as workerRole, r.color as roleColor, r.name as departement, conge_annee, c.name as companyName, c.logo as logoCompany, p.title as poste',FALSE)->from('Workeforce w')->join('Role r', 'r.ID = w.RoleID')->join('Company c', 'c.ID = w.CompanyID')->join('poste p', 'p.id = w.poste_id', 'left')->where('w.worker_role <', 100);

$query=$this->db->select('CONCAT(w.firstName,”,w.lastName)如全名,w.ID,w.firstName,w.lastName,w.firstName,w.lastName,w.cin,w.tel,w.poste,w.ID,w.gender,w.date,w.date,w.EndContract,w.address,w.address,w.lastName,w.FamilyStuation,w.socialSecurity,w.typeContract,w.period,w.email,w.status,r.name,w.conge,w.cng,w.StartDateProfile,wges、w.passport、w.passport\u end\u date、w.urgent\u phone\u name、w.pointage\u id作为Idpointer、w.shift\u start作为heure\u arr、w.shift\u end作为heure\u dep、w.worker\u角色作为workerRole、r.color作为部门、conge\u annee、c.name作为公司名称、c.logo作为logo公司、p.title作为poste)、FALSE)->来自('Workforce w')->加入('Role r','r.ID=w.RoleID')->join('Company c','c.ID=w.CompanyID')->join('poste p','p.ID=w.poste_ID','left')->其中('w.worker_Role尝试在您的CONCAT中转义引号。
您的错误指出“'CONCAT(w.firstName')不是有效的列,这一事实向我表明,您的DB认为SELECT结束于此

CONCAT(w.firstName,\" \",w.lastName) as fullName, ....
在引号前添加\将使其消失。
您可以在此处阅读有关转义特殊字符的更多信息:

尝试将CONCAT中的引号转义。
您的错误指出“'CONCAT(w.firstName')不是有效的列,这一事实向我表明,您的DB认为SELECT结束于此

CONCAT(w.firstName,\" \",w.lastName) as fullName, ....
在引号前添加\将使其消失。
您可以在此处阅读有关转义特殊字符的更多信息: