Hi,

Don't know if this is an OT or not.

I have a MySQL database for books. The ISBN field is set as varchar(15) and
I've put a test ISBN number in of 1-1111-111-11. Can someone tell me why
this SQL query isn't working?

$ISBN = $_GET['isbn'];
$query = "SELECT * FROM book_details WHERE ISBN = '$ISBN'";

Since the field is a varchar, should wrapping the variable (1-1111-111-11)
in single quotes work?

If I change the data in the table to 'abcd' and run this query

$ISBN = 'abcd';
$query = "SELECT * FROM book_details WHERE ISBN = '$ISBN'";

It works.

PHP Version 4.3.2
mysql-4.0.14b

Thanks,
James


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to