This topic is locked
[SOLVED]

 How can I prevent showing all records?

5/14/2014 8:12:18 AM
PHPRunner General questions
R
rdrygas author

Hi,
In Events -> List page -> List page: Before SQL query I use a condition

if ( @$_REQUEST["a"] == "integrated" && !@$_REQUEST["ctlSearchFor"] )

$strWhereClause = whereAdd( $strWhereClause, "1=0" );


to prevent showing all records by entering an empty string. But unfortunately this is not working when I enter a space or several spaces - then displays all records :-( How can I fix it?
PHPRunner 6.0 build 10638

R
rdrygas author 5/14/2014

I think I've solved problem :-) I changed the code to

$strWhereClause = trim ( $strWhereClause );
if (( @$_REQUEST["a"] == "integrated" && !@$_REQUEST["ctlSearchFor"] ) || ( $strWhereClause == "" ))

$strWhereClause = whereAdd( $strWhereClause, "1=0" );


It seems that it works.