Thread: Firebird Query with parameters: Query->RecordCount; Apache crash
Posts:
8
Registered:
2/13/13
|
|
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.
|
|
|
Posts:
8
Registered:
2/13/13
|
|
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)
|
|
Connect with Us