Hi,
I'm using this to do a search
function search($entryType, $word, $startRow, $endRow)
{
GLOBAL $db,$table;
$type = trim($entryType);
$word = trim($word);
$startRow = trim($startRow);
$endRow = trim($endRow);
$query = mysql_query("SELECT title, description FROM $table WHERE title like '%$word%' OR description LIKE '%$word%' ORDER BY viewed DESC LIMIT $startRow,$endRow");
//
$query2 = mysql_num_rows($query);
if($query2<=0)
{
return "&error=" . mysql_error();
} else {
$counter = 0;
while ($row = mysql_fetch_array($query)){
$counter ++;
echo "&title"."$counter=".$row['title'];
echo "&description"."$counter=".$row['description'];
echo "&url"."$counter=".$row['link'];
echo "&viewed"."$counter=".$row['viewed'];
echo "&date"."$counter=".$row['date'];
echo "&id"."$counter=".$row['index'];
}
echo "&counter=".$counter;
return "&user=ok";
}
}
it seems to be returning the correct entries, but not the correct data for each. The Title was returned fine but all the other fields were returned with something like this on the end
"<font color=ff0000>\nNotice: Undefined index: index in /home/website/public_html/website/functions.php on line 117\n</font>"
its the same for all the other fields returned, any ideas??
boombanguk