Re: [PHP] Re: Vars inside an sql query [Regular expression question]

2003-06-12 Thread Hatem Ben
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 = &

RE: [PHP] Re: Vars inside an sql query [Regular expression question]

2003-06-12 Thread Monu Ogbe
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 = "

RE: [PHP] Re: Vars inside an sql query [Regular expression question]

2003-06-12 Thread Jay Blanchard
[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

RE: [PHP] Re: Vars inside an sql query [Regular expression question]

2003-06-12 Thread Monu Ogbe
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

Re: [PHP] Re: Vars inside an sql query [Regular expression question]

2003-06-12 Thread Hatem Ben
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

Re: [PHP] Re: Vars inside an sql query [Regular expression question]

2003-06-12 Thread Hatem Ben
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 > >

Re: [PHP] Re: Vars inside an sql query [Regular expression question]

2003-06-12 Thread Chris Hayes
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

[PHP] Re: Vars inside an sql query [Regular expression question]

2003-06-12 Thread DvDmanDT
That doesn't work as the new string already is like "select * FROM `table` where id='2' order by name" assuming $value was 2... "Hatem Ben" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] Greetings all, I got a headache doing this, i need to get vars inside an sql query. For example