This topic is locked

Simple Search with two Keywords

1/22/2007 5:38:08 PM
PHPRunner General questions
zzapper author

Hi,

The "Simple" Search at the top of the PHPRunner List Page only allows one keyword/phrase to be searched for
How can I create/generate a Search form which would allow two keywords to searched for
ie

KEYWORD1 AND KEYWORD1

T
thesofa 1/22/2007

use advanced search?

zzapper author 1/23/2007

use advanced search?


Advanced Search is field specific, and does not help in this case

Sergey Kornilov admin 1/23/2007

This feature is not available in current version of PHPRunner.
As a custom solution you can build ListOnLoad event that processes input and builds SQL query that can be assigned to $strSQL variable (make sure you define it as global $strSQL;)

zzapper author 2/25/2007

This feature is not available in current version of PHPRunner.

As a custom solution you can build ListOnLoad event that processes input and builds SQL query that can be assigned to $strSQL variable (make sure you define it as global $strSQL;)


Sergy

I have created
function ListOnLoad()

{

global $strSQL;
//** Custom code ****

// put your custom code here

$strSQL = AddWhere($strSQL,"`valid`=1");

}
It seems to be totally ignored
here is why:=
.... like upper('%pai%') or upper(`tbl_password`.`email`) like upper('%pai%') order by 3 desc) and (`valid`=1);
The extra where clause is after the order by 3 desc
phprunner 3.1 build 218
zzapper

Alexey admin 2/26/2007

Hi,
either implement more intelligent modification of SQL string or add your code directly to generated ..._list.php file before ORDER BY clause is added.

Here is the place in the script to put your code to:

if(@$_SESSION[$strTableName."_search"]==1)

// regular search

{

...

// put your code here

...

}

else if(@$_SESSION[$strTableName."_search"]==2)

// advanced search

zzapper author 2/26/2007

Hi,

either implement more intelligent modification of SQL string or add your code directly to generated ..._list.php file before ORDER BY clause is added.

Here is the place in the script to put your code to:


Hi Alexey,

The problem with above is that the code has to be reinserted after very build ?
I've found a QAD solution I use my Perl:DBI script to query my database but then link through to the relevant PHPRunner generated file for viewing/editting eg
$db_edit=qq|/passwords2/tbl_password_edit.php?editid1=$id|;

$db_view=qq|/passwords2/tbl_password_edit.php?viewid1=$id|;
Basically my Perl MySQL query (must try a PHP version) just needs to find the $id
--

zzapper
7 Easy Ways ANYONE can start Earning Money on the Web NOW!

http://successtheory.com/tips/