MySQL Forums
Forum List  »  PHP

Re: Select Where problem
Posted by: Peter Brawley
Date: November 21, 2015 04:11PM

1. title values are strings, so they have to be quoted

2. See the PHP manual, PHP substitutes variable values in double-quoted strings only.

3. The outer string has to be double-quoted, so $title has to be single-quoted:

$qry = "SELECT * FROM books WHERE title = '$title'";



Edited 1 time(s). Last edit at 11/23/2015 10:28AM by Peter Brawley.

Options: ReplyQuote


Subject
Written By
Posted
November 21, 2015 02:28PM
Re: Select Where problem
November 21, 2015 04:11PM
November 23, 2015 03:41PM
November 23, 2015 04:47PM
November 24, 2015 07:38AM
November 22, 2015 11:20PM
November 23, 2015 09:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.