on 3/30/03 9:52 AM, Charles Kline at [EMAIL PROTECTED] appended the
following bits to my mbox:

> i was just wondering if there are any naming conventions when creating
> database connections. most of my books use
> $sql = "SQL STRING";
> and
> $sth = $db->query() or $result = $db->query()
> I have no idea what sth stands for in this case, but was curious how
> others name stuff.

I usually just use $query or $q for "query," $res or $r for "result," $row
or $s for the returned array, and $dbh for the database connection.  I got
the latter from the standard Perl database connection, "dbh -> Data Base

If I recall correctly, the $sth also comes from the standard perl examples.
The standard PHP example, from http://www.php.net/manual/en/ref.mysql.php ,
uses $link for the connection, $query for the query, and $line for the
returned record array.

A lot of database classes use $db as the new object.

Hope that helps.


Paul Burney

    while ($self != "asleep") {

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

Reply via email to