Originally posted by David Steckbeck
Clearly, you have a problem, but it is not obvious because it lies in your search code, not the code that calls the search.
Try looking in your search.php file, where it uses the variable $s, and look at how it is structuring (on return) the data when it calls the database (assuming it performs a search on a database).
Oops! You're right - not feeling well, but need to finish this project a.s.a.p..
I know my search page works -- the problem is, however, the form input text (located within my 'head_nav_bar')named "s" is not being saved in such a way that the search page can retreive it. I test the search page by changing the initialization value to text I knew existed within my database; AND I appended the URL with: ?s=some_text_in_my_database
the search performed beautifully.
Thanks. Here's the code. Should the action statement within the form read: <? $PHPSELF ?> ??? Here's my code for the search page:
<?php
//grab search criteria
//display 10 items at a time with links to details
require("./../adodb/adodb.inc.php");
require("./../Connections/inventory.php");
?>
<?php
//set max number of rows
$KT_numRows_search = 10
?>
<?php
//initialize variable and test for contents
$searchMMColParam = "1";
if (isset($HTTP_GET_VARS["s"])) {
$searchMMColParam = $HTTP_GET_VARS["s"];
}
?>
<?php
//do the searching
if (isset($KT_Tot) && $KT_Tot!="") {
if(!isset($KT_numRows_search)){
$KT_numRows_search=1;
}
$KT_index = (int)$KT_index;
$search = $inventory->SelectLimit("SELECT FROM Products WHERE ProductDescription LIKE '%" . ($searchMMColParam) . "%'", $KT_numRows_search, $KT_index) or KT_DIE($inventory->ErrorNo(),$inventory->ErrorMsg());
$searchtotalRows = $HTTP_GET_VARS["KT_Tot"];
$searchisLimited = true;
} else {
$search = $inventory->Execute("SELECT FROM Products WHERE ProductDescription LIKE '%" . ($searchMMColParam) . "%'") or KT_DIE($inventory->ErrorNo(),$inventory->ErrorMsg());
$searchtotalRows=$search->RecordCount();
}
?><?php
$Repeat1numRows = 10;
$Repeat1index= 0;
$search_numRows = $search_numRows + $Repeat1numRows;
?><?php
$Repeat2numRows = 10;
$Repeat2index= 0;
$search_numRows = $search_numRows + $Repeat2numRows;
?><?php require_once(ADODB_DIR."/KTmoveTo_keepParams.php"); ?><?php
//MoveTo and Recordset Statistics init vars
if(!isset($KT_Tot) || $KT_Tot==""){
$KT_Tot=$searchtotalRows;
}
if(!isset($KT_index) || $KT_index==""){
$KT_index=0;
}
if(!isset($KT_numRows_search)){
$KT_numRows_search=1;
}
if($KT_index>=$KT_Tot){
$KT_index=0;
}
if($KT_index<0){
$KT_index=0;
}
?><?php
//handle Recordset Statistics
$search_total = $KT_Tot;
$search_first = min($KT_Tot, $KT_index+1);
$search_last = min(max($search_first, $KT_index+$KT_numRows_search), $KT_Tot);
?><?php
//handle MoveTo vars and links
$MM_offset = $KT_index;
$MM_atTotal = ($search_last == $search_total);
$KT_toPrev = max(0, $KT_index-$KT_numRows_search);
$KT_toLast = max(0, $KT_Tot-$KT_Tot%$KT_numRows_search);
if($KT_toLast == $KT_Tot){
$KT_toLast = max(0, $KT_Tot-$KT_numRows_search);
}
$KT_toNext = min($KT_index+$KT_numRows_search, $KT_toLast);
$MM_moveFirst = $MM_movePrev = $MM_moveNext = $MM_moveLast = $PHP_SELF."?".$MM_keepBoth;
addReplaceParam(&$MM_moveFirst, "KT_index", 0);
addReplaceParam(&$MM_moveFirst, "KT_Tot", $KT_Tot);
addReplaceParam(&$MM_movePrev, "KT_index", $KT_toPrev);
addReplaceParam(&$MM_movePrev, "KT_Tot", $KT_Tot);
addReplaceParam(&$MM_moveNext, "KT_index", $KT_toNext);
addReplaceParam(&$MM_moveNext, "KT_Tot", $KT_Tot);
addReplaceParam(&$MM_moveLast, "KT_index", $KT_toLast);
addReplaceParam(&$MM_moveLast, "KT_Tot", $KT_Tot);
if(!isset($search__isLimited)){
for($KT_i=0;$KT_i<$KT_index;$KT_i++){
$search->MoveNext();
}
}
?>
//Begin HTML
//End HTML