html.form.class.php: Fixed SQL error (projects)
1. Strings should be quoted by single quotes 2. GROUP BY declaration must list all fields from SELECT statement
This commit is contained in:
parent
b2ba1f5540
commit
1a38d075a6
@ -8118,8 +8118,8 @@ class Form
|
||||
}
|
||||
|
||||
// Search all projects
|
||||
$sql = 'SELECT f.rowid, f.ref as fref, "nolabel" as flabel, p.rowid as pid, f.ref,
|
||||
p.title, p.fk_soc, p.fk_statut, p.public,';
|
||||
$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref,
|
||||
p.title, p.fk_soc, p.fk_statut, p.public,";
|
||||
$sql .= ' s.nom as name';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'projet as p';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc,';
|
||||
@ -8129,7 +8129,7 @@ class Form
|
||||
//if ($projectsListId) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
||||
//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
|
||||
//if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
|
||||
$sql .= " GROUP BY f.ref ORDER BY p.ref, f.ref ASC";
|
||||
$sql .= " GROUP BY f.ref, f.rowid, flabel,pid, p.title, p.fk_soc, p.fk_statut, p.public, name ORDER BY p.ref, f.ref ASC";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user