sorry to bother with these warnings, but im getting frusterated.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/test/search2.php on line 83
$sql = mysql_query("SELECT * FROM table WHERE MATCH (item) AGAINST ('$searchValue') LIMIT $from, $max_results");
while($row = mysql_fetch_array($sql)){
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/www/test/search2.php on line 128
// Figure out the total number of results in DB:
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM table WHERE MATCH (item) AGAINST ('$searchValue')"),0);
this is how i get the value of $searchValue:
// Collect Seach Value & Turn into Session
session_start();
if (!empty($_GET["searchValue"]))
$searchValue = trim($_GET["searchValue"], 25);
elseif (!empty($_POST["searchValue"]))
$searchValue = trim($_POST["searchValue"], 25);
else
{
session_is_registered("sessionSearchValue");
$searchValue = $_SESSION["sessionSearchValue"];
}
these warnings are shown when i try to run my script...
no results are shown!
I don't understand why i am getting these warnings... I have an almost identical script, that searches the same query, except there is not user input, and that script runs fine.
it seems when i add the user input, everything goes wrong!! why?