Hi ya
I have a problem with this bit of code (edited out stuff that isn't relevent)
The error I get is "Main Error" - I checked that before the "$res = mysql_query....." is executed that the value of $query is fine - and it is.PHP Code:$mysql_database_reviews = "wildwayz_reviews";
$mysql_username = "someuser";
$mysql_password = "somepassword";
function SearchReviews($query)
{
mysql_connect("localhost","$mysql_username","$mysql_password");
mysql_select_db($mysql_database_reviews);
$tbuf = $buffer;
$res = mysql_query("SELECT * FROM reviews WHERE title like '%$query%' OR actors like '%$query%'") or die("Main error");
$num = mysql_num_rows($res);
}
What I am doing is trying to get a search working for my review database which is sent through a form.
It works fine for my news database (values changed though)
and that works fine, but not the first onePHP Code:$res = mysql_query("SELECT * FROM news WHERE headline like '%$query%' or preview like '%$query%' or tekst like '%$query%'") or die("Main error");
$num = mysql_num_rows($res);
Any ideas?
James




Bookmarks