yeaaa... sorry i did not read that last bit you wrote.. i will look out for little errors like that...
this is what i got so far
<?php
mysql_connect("Localhost","root");
mysql_select_db("hamzy");
if (!isset($_POST['search']) || $_POST['search'] == '')
{
echo 'no search entered';
}
else
{
$search = $_POST['search'];
$query = "SELECT Title, Author, Price FROM books WHERE Title LIKE '%$search%' OR Author LIKE '%$search%";
}
$search_result = mysql_query($query);
while ($row = mysql_fetch_array($search_result))
{
$field1 = $row["Title"];
$field2 = $row["Author"];
$field3 = $row["Synopsis"];
$field4 = $row["Price"];
$field3 = substr($field3, 0, 200);
echo "<b>$field1</b><br> $field2</br> $field3 ...<b>£$field4</b></p>";
}
?>
now im getting a "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\wamp\www\copy of index.php on line 37"
line 37 is the while line!
thats on the line of the while statment... when i added a ";" at the end of it i got that error message again but with a "...£" ????