This topic is locked

SAVING SEARCHES

1/6/2008 6:41:42 PM
PHPRunner General questions
H
hlewis author

Hi,
I was wondering if anyone had a script for saving searches? What I'm after is a script that will save data from a (submitted) search page into a table of saved searches. The searches should be indetifiable by user, so users only have access to their own saved searches. So all users would have to do is name the search before saving. The only displayed field from the saved search table would be the search name. and then select
This obviously avoids users having to re-enter search field when repeating search queries.
This is very similar to saving user searches in E Bay.
Any examples / samples would eb appreciated.only users have access to their own searchesffor a logged in user, once theyrom a search pag have

J
Jane 1/9/2008

Hi,
you can save searches to another table in the List page: Before process event. Save username of logged user and search keyword.

To restrict access use User can see and edit their own record only option on the Advanced security settings dialog on the Security tab.

R
Rigmantas 2/13/2008

Hi,

you can save searches to another table in the List page: Before process event. Save username of logged user and search keyword.

To restrict access use User can see and edit their own record only option on the Advanced security settings dialog on the Security tab.



Hi,

Can your explain this,

I test many examples for this moment but.... <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=25841&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />

In PHPRUNNER I found this event but I think that is not what us needed

//** Insert a record into another table ****

global $conn;

$strSQLInsert = "insert into TableName (Field1, Field2) values (Value1, Value2)";

db_exec($strSQLInsert,$conn);
Thanks

J
Jane 2/14/2008

Hi,
your code is just a sample.

You need to add your actual values to the query:

global $conn;

if ($_REQUEST["SearchFor"] && $_SESSION["UserID"])

{

$strSQLInsert = "insert into TableName (Field1, Field2) values ('".$_SESSION["UserID"]."','".$_REQUEST["SearchFor"]."')";

db_exec($strSQLInsert,$conn);

}