Re: escaping ' when inside a " "
| From: | Curt Zirzow | Date: | Tue, 18 Nov 2003 15:00:42 +0000 |
| Subject: | Re: escaping ' when inside a " " | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-170103@lists.php.net to get a copy of this message | ||
* Thus wrote Marek Kilimajer (kilimajer@webglobe.sk):
> Adam Williams wrote:
> >If I have the SQL statement:
> >
> >$sql = "select subject from subwhile where subject = '*$var[0]*'";
>
> Don't you want to do:
> $sql = "select subject from subwhile where subject LIKE '%$var[0]%'";
I think more precisely:
$sql = "select subject from subwhile where subject LIKE '%{$var[0]}%'";
Curt
--
"My PHP key is worn out"
PHP List stats since 1997:
http://zirzow.dyndns.org/html/mlists/