Re: String within a string

From: Date: Sun, 16 Jun 2002 18:06:46 +0000
Subject: Re: String within a string
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-102406@lists.php.net to get a copy of this message
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 single quote *before* % and then a double quote after the % is: There is a single quote in the above example because all strings *within* a mysql expression which already starts and ends with double quotes must have a single quote to differentiate the two quotes - double and single. Please disregard esacping characters in this example. Double quotes and single quotes. And in this case, the code begins with double quotes and ends with double quotes *before* the concatenation operator and variable. The string which comes before the first string ends needs a single quote as in: '%" file://here comes the concenation operator and variable and then: // variable and concenation operator and " %' "; The end single quote then resumes *after* the variable and next concatention operator. Thank you. TR

« previous php.general (#102406) next »