Commit 8e9c2625 by Scott

Fix MySQL reserved keyword clash

Fixes #725
parent 113b350b
......@@ -548,8 +548,9 @@ function qa_db_single_select($selectspec)
$query = 'SELECT ';
foreach ($selectspec['columns'] as $columnas => $columnfrom)
$query .= $columnfrom . (is_int($columnas) ? '' : (' AS ' . $columnas)) . ', ';
foreach ($selectspec['columns'] as $columnas => $columnfrom) {
$query .= is_int($columnas) ? "$columnfrom, " : "$columnfrom AS `$columnas`, ";
}
$results = qa_db_read_all_assoc(qa_db_query_raw(qa_db_apply_sub(
substr($query, 0, -2) . (strlen(@$selectspec['source']) ? (' FROM ' . $selectspec['source']) : ''),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment