I have posted about this a couple times before. I was receiving some help but the user helping me has not come back in almost a month.
I am trying to set up a search on my website that looks through my database and displays the results (very simplified search engine). I have a table with about 500 entries.
[QUOTE]
<?
include “DBConnect.inc.php”;
//connect to server and database
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( “Unable to select database”);
//specify how many results to display per page
$limit = 10;
// Get the search variable from URL
$var = @$_GET[’10’] ;
//trim whitespace from the stored variable
$trimmed = trim($var);
//separate key-phrases into keywords
$trimmed_array = explode(” “,$trimmed);
// check for an empty string and display a message.
if ($trimmed == “”) {
$resultmsg = “<p>Search Error</p><p>Please enter a search…</p>” ;
}
[B]
[COLOR=”DarkRed”]// check for a search parameter
if (!isset($var)){
$resultmsg = “<p>Search Error</p><p>We don’t seem to have a search parameter! </p>” ;
}
This is only part of the code but this is where it seems the function stops working as I am getting the error “We dont seem to have a search parameter.
I am fairly new to this and I would really appreciate anyones help.
Thanks!