Re: [PHP] String within a string

2002-06-16 Thread Anthony Ritter
Many thanks Chris. Tony --- [This E-mail scanned for viruses by IAS, an Archiventure Company] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] String within a string

2002-06-16 Thread Chris Shiflett
I might be misinterpreting the question, because it sounds like the same question as before. Let me try to be more thorough. SQL statements traditionally use single quotes around literal values. There is no reason of "escaping" that makes this characteristic exist. Now, in PHP, most people con

Re: [PHP] String within a string

2002-06-16 Thread Anthony Ritter
Chris, Maybe I didn't make myself clear... "LIKE '%"// Beginning of double quote and then beginning single quote beacuse it is the beginning of a string which then ends before the variable $searchterm. .. Is the reason that the is a si

Re: [PHP] String within a string

2002-06-16 Thread Chris Shiflett
Each item within double quotes is a literal string. The example you inquire about dynamically builds an SQL statement. For example, if $searchtype is "author_name" and $searchterm is "Rasmus", then you would build a statement like: select * from books where author_name like '%Rasmus%'; The SQ

[PHP] String within a string

2002-06-16 Thread Anthony Ritter
I want to make sure about the syntax using mysql and PHP. Here is the line of code: $query="SELECT * FROM books WHERE ". $searchtype. " LIKE '%" .$searchterm. "%' "; . Am I correct that the reason for the single quote within the expression above is th