Skip to content

Commit

Permalink
Start translating status codes
Browse files Browse the repository at this point in the history
This SQL isn't working, and I have no idea why. I don't think I've ever used correlated subqueries in SELECT clauses in SQLite. Toward #98.
  • Loading branch information
waldoj committed Sep 21, 2019
1 parent 3b91bc5 commit 941fd39
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion includes/class.Business.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,38 @@ function fetch()
return FALSE;
}

$sql = 'SELECT *
$sql = 'SELECT *,
(SELECT tables.Description
FROM tables
WHERE tables.TableID="01"
AND tables.ColumnID="Status"
AND tables.ColumnValue=corp.Status) StatusText,
(SELECT tables.Description
FROM tables
WHERE tables.TableID="03"
AND tables.ColumnID="IndustryCo"
AND tables.ColumnValue=corp.IndustryCode) Industry,
(SELECT tables.Description
FROM tables
WHERE tables.TableID="04"
AND tables.ColumnID="RA-Status"
AND tables.ColumnValue="corp.RA-Status") "RA-StatusText",
(SELECT tables.Description
FROM tables
WHERE tables.TableID="05"
AND tables.ColumnID="RA-Localit"
AND tables.ColumnValue="corp.RA-Loc") "RA-LocText",
(SELECT tables.Description
FROM tables
WHERE tables.TableID="07"
AND tables.ColumnID="AssessInd"
AND tables.ColumnValue="corp.AssessInd") "AssessIndText"
FROM corp
WHERE EntityID="' . $this->id . '"';
$result = $this->db->query($sql);
Expand Down

0 comments on commit 941fd39

Please sign in to comment.