Daniel Convissor wrote:
Hi Kristina:
On Wed, Apr 02, 2008 at 08:49:08AM -0700, Kristina Anderson wrote:
I name each query $query1,
query2, etc rather than what I see in a lot of PHP code I've inherited,
where each query is simply named $query, even if there are 6 or 7 of
them on the page.
I use $sql for all queries. It's short and to the point. Plus it
ensures you're running the most recenlty defined $sql and are not adding
overhead with extra variables. It also allows you to copy and paste the
actual query execution line over and over and over without having to
worry (which is probably how your bug got introduced).
Even if you want to give each query string a unique variable name, don't
name them 1, 2, 3. Give them real names that descirbe what they are.
Normally I wouldn't waste bandwidth with a "me too" response, but Dan's
reply here is very clear and to the point. Simplicity can be a very
powerful productivity tool.
--
Kenneth Downs
Secure Data Software, Inc.
www.secdat.com www.andromeda-project.org
631-689-7200 Fax: 631-689-0527
cell: 631-379-0010
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php