I am wanting to add a record to a table named Search Query each time a visitor uses the search function.
I assume it will be a variant of this code int the Before SQL Event,
global $conn;
$strSQLInsert = "insert into TableName (Field1, Field2)
values (Value1, Value2)";
db_exec($strSQLInsert,$conn);
I want Value2 to be the time and date and value one to be the visitor's search term.
Once I have this, I would like to have that table only keep the last 500 records...
I want to have this work for either advanced or basic search and alos for the code below which is on my View Page.
<FORM name=frmSearch action="http://www.weisd.com/test/WEISD_TBL_list.php" method=get target=_self>
<input type="Hidden" name="a" value="search">
<input type="Hidden" name="value" value="1">
<INPUT type=text name="SearchFor"
onkeydown="e=event; if(!e) e = window.event; if (e.keyCode != 13) return true; e.cancel = true; frmSearch.submit(); return false;"
>
<input type="Hidden" name="SearchOption" value="Contains">
<input type="Hidden" name="SearchField" value="">
<input type="submit" value="Search">
</FORM>
I am already capturing Basic, advance, and SearchFor in a Before Display event to use for pagetitle etc in the resulting search results so Iassume it is just a matter of setting Value1 to the query and value2 to the date but I am not sure of the syntax need...