I am using the following details to search my MySQL database
query string: ...index.php?keywords=ashley&submit=%3E%3E
using the following code to retrieve the passed variables: $var =
$_GET['keywords'];
Then structuring my query as follows
$sql = "SELECT url, caption, date FROM photos WHERE keywords LIKE
'%$var%' ORDER BY date ASC ";
printing the query gives the following:
SELECT url, caption, date FROM photos WHERE keywords LIKE '%ashley%'
ORDER BY date ASC
If I execute the following 2 lines of code the result I get from this query
is: Resource id #3 followed by the fatel error below
$result = mysql_query($sql);
echo $result;
Fatal error: Unsupported operand types in C:\Program Files\Apache
Group\Apache2\htdocs\galleryone\includes\photo.php on line 16
Line 16 is:
$start = $row * $numtoshow;
This error is not returned if the function uses other queries I have sent to
it.
Appreciate any suggestions
David