PHP Application Generator

  • Status Fixed
  • Percent Complete
    100%
  • 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
Attached to Project: PHP Application Generator
Opened by aducomadmin - 24.06.2021

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

Tasklist

Task Details

Task Editing