- Status Fixed
- Percent Complete
- Task Type Bug Report
- Category Backend / Core
- Assigned To No-one
- Operating System Windows 10
- Severity Low
- Priority Medium
- Reported Version 2.0.X
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#332 - Runtime error when DBSimpleQuery SQL Sentence includes single quotes
<p></p>STEPS To reproduce:
Put a cDBSimpleQuery in any form. Set the SQL property to any query containing a constant string, like this:
select ‘X’ as hilera
Run the form.
Error message
tonguearse error: syntax error, unexpected ‘X’ (T_STRING) in C:PHsPeedxampphtdocsgestionit_libstest2_dbsquery_1.php on line 12
The generated file looks like this:
class test2_dbsquery_1 extends spdbsimplequery {
public function __construct($app, $form) { parent::__construct('test2_dbsquery_1'); $this->app=$app; $this->sql='select 'X' as hilera';
}
This does not happens if I use a cDBQuery, because the assignment to the sql property is enclosed in double quotes:
(taken from another, cDBQuery component generated file)
… $this→selectSQL=”select pkCasa,nombreCasa,’X’ as hilera “.
…
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task