une 12, 2003 3:17 PM
Subject: RE: [PHP] Re: Vars inside an sql query [Regular expression
question]
[snip]
$string = "select * FROM `table` where id='$value' order by name";
[/snip]
I know it ain't pretty, but the coding style we have accepted is
this
$string = &
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Re: Vars inside an sql query [Regular expression
question]
Hi,
I'll join the conversation, because I have a similar problem.
PHP "interpolates" variable values in strings if these are enclosed in
double quotes:
e.g.,
$string = "
[snip]
$string = "select * FROM `table` where id='$value' order by name";
[/snip]
I know it ain't pretty, but the coding style we have accepted is
this
$string = "select * FROM `table` where id = '" . $value . "' order by
name ";
or (we requite caps on reserved words)...
$string = "SE
Hi,
I'll join the conversation, because I have a similar problem.
PHP "interpolates" variable values in strings if these are enclosed in
double quotes:
e.g.,
$string = "select * FROM `table` where id='$value' order by name";
PHP does not interpolate variables contained in strings delimi
Sorry this is more correct :
-- starting query.php
select * FROM `table` where id='$value' order by name
-- ending query.php
"Hatem Ben" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Oh, ok this is how i want to do it exactly :
> query.php
> $query
Oh, ok this is how i want to do it exactly :
query.php
parse.php
Thanks
"Chris Hayes" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> At 13:54 12-6-03, you wrote:
> >>I got a headache doing this, i need to get vars inside an sql query. For
> >
At 13:54 12-6-03, you wrote:
I got a headache doing this, i need to get vars inside an sql query. For
example :
$query = "select * FROM `table` where id='$value' order by name";
preg_match_all("/^('\$(.*)')/si", $query,$matches);
That doesn't work as the new string already is like "select * FROM
7 matches
Mail list logo