Hi all,
I am trying to wrire a SQL statement that will find the records that contain the content of the query.
This is what I have so far:
$_POST could contain a string of numbers or text.
;
$_POST['isbn'] = 1843341670;
$query = $_POST['isbn']
mysql_select_db($database_biohealth, $biohealth);
$query_booksresult = sprintf("SELECT * FROM books WHERE isbn_hardback = " . $query . " OR book_title LIKE '%$query%' OR author_name LIKE '%$query%'");
$booksresult = mysql_query($query_booksresult, $biohealth) or die(mysql_error());
When I run the query using a know number the result is the first record in the data table, "1843340488" and not the one I am searching for.
Can anyone please advise and point me in the right direction.