I agree with you Jay, but those cases are already done, and i got no problem
with RE there

Thanks anyway
Hatem


----- Original Message -----
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "Monu Ogbe" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, June 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 = "select * FROM `table` where id = '" . $value . "' order by
name ";

or (we requite caps on reserved words)...

  $string = "SELECT * ";
  $string .= "FROM `table` ";
  $string .= "WHERE id = '" . $value . "' ";
  $string .= "ORDER BY name ";

No ambiguity and cleaner on longer queries.

It's all in preference I suppose.

Jay

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to