This topic is locked
[SOLVED]

 How to find out the variable name for search

6/8/2011 7:30:38 AM
PHPRunner General questions
P
peaceful author

I'm using PHPRunner 5.2.7474 to created a webpage (with basic search function), I've created a snippet to obtain data, but I'm kind of stuck...
Does anyone know how to find out the variable for basic search, I would like to input the variable names into ???? appreciate your advice.


$con = mysql_connect("localhost","admin","password");
mysql_select_db("my_db", $con);
$searchstr= ????
$result = mysql_query("SELECT * FROM Table WHERE Column1='$searchstr'");
$row = mysql_fetch_array($result);

echo $row['Column2'] . " " . $row['Column3'];

echo "<br />";





mysql_close($con);


P
peaceful author 6/8/2011

I'm still can't figure how to obtain the search how to link the search value into my code... <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=58774&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />

L
Lena 6/9/2011

Hi,

to get value from basic search use this code in the List page: Before SQL query event:



global $strTableName;

if (isset($_SESSION[$strTableName.'_advsearch'])){

include_once("classes/searchclause.php");

$searchClauseObj = unserialize($_SESSION[$strTableName.'_advsearch']);

if ($searchClauseObj->isUsedSrch()){

if ($searchClauseObj->_where[$strTableName."_simpleSrch"] != ''){

$searchstr = $searchClauseObj->_where[$strTableName."_simpleSrch"]; // value from basic search

}

}

};
P
peaceful author 6/9/2011

Thanks Sergey & Lena... I managed to capture the search value via $_session.... Cheers!