Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Firebird Query with parameters: Query->RecordCount; Apache crash



Permlink Replies: 1 - Last Post: Jun 29, 2016 6:27 PM Last Post By: ivan ivanov
ivan ivanov

Posts: 8
Registered: 2/13/13
Firebird Query with parameters: Query->RecordCount; Apache crash
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 27, 2016 3:06 AM
While browsing some free components came across the problem above. After debug found the crash line: for example:
 echo $this->Query1->RecordCount;


If anyone met this problem, the solution is to link any datasource to the the query.
ivan ivanov

Posts: 8
Registered: 2/13/13
Re: Firebird Query with parameters: Query->RecordCount; Apache crash
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 29, 2016 6:27 PM   in response to: ivan ivanov in response to: ivan ivanov
Unfortunately, the described solution is partial and only works if datasource is placed as a component. If it is dynamically generated, the problem remains.
Based on this, after several tests I can describe better the problem and the solution.
      $myQuery = new Query();
      $myQuery->Database = $this->myDatabase;
      $username = 'testuser'; $password = 'test';
       $SQL = 
      'SELECT * FROM ' . $this->UserLogin1->UserTable . ' ' .
      'WHERE Username = ' . $this->UserLogin1->Database->Param('Username') . ' AND PASSW = ' . $this->UserLogin1->Database->Param('Password');
      $myQuery->Active = false;
      $myQuery->setSQL($SQL);
      $myQuery->setParams(array($username, $password));
      $myQuery->Active = true;
      echo $myQuery->RecordCount; // ! This line forces apache to crash

The solution:
 $myQuery = new Query($this); //only place owner parameter in constructor
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02