Re: [PHP-DB] naming conventions

2003-03-30 Thread Roberto Plomp
In essence it doesn't matter so much which convention you use as long you
use a convention, use it consistently and the convention itself doesn't come
with too much complexity of it's own and is based on a clear philosophy.

The naming convention I use in any environment or language uses simple
prefixes and is based on two points:
1. the name should show the origin of the variable/function/table/query and
what
more;
2. it should show the functional context / meaning

In other words:
1. Where can I find it;
2. What does it mean.

Of course, the naming convention must be combined with structure
conventions.

Just thinking along ...
Roberto


- Original Message -
From: Paul Burney [EMAIL PROTECTED]
To: Charles Kline [EMAIL PROTECTED]; PHP Database List
[EMAIL PROTECTED]
Sent: Sunday, March 30, 2003 5:19 PM
Subject: Re: [PHP-DB] naming conventions


 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
 Handle.

 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.

 Sincerely,

 Paul Burney
 http://paulburney.com/

 ?php
 while ($self != asleep) {
 $sheep_count++;
 }
 ?



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





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



Re: [PHP-DB] Calling functions recursively

2003-01-25 Thread Roberto Plomp
If you mean that it would be more straight forward, hence neater and more
comprehensive and more maintenance and stack friendly to just call the
function in a loop, I agree.

On the other hand ... well, there are arguments for the recursive approach
for a number of algorithms.

Personally I prefer not to use recursive functions, have never really seen
the absolute necessity to do so.

Roberto

- Original Message -
From: Jason Wong [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Calling functions recursively


 On Saturday 25 January 2003 14:49, Kevin Gordon wrote:
  Can functions / methods be called recursively? If so how can this be
  done? Comments much appreciated.

 google  php recursive functions

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *


 /*
 QOTD:
 I've just learned about his illness.  Let's hope it's nothing
 trivial.
 */




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




Re: [PHP-DB] Calling functions recursively

2003-01-24 Thread Roberto Plomp
Kevin,

Have fun and be sure to guarantee the prevent never ending looping.

Roberto

?php
function RecursiveFunction($aCounter)
 {
 if($aCounter = 10)
  {
  echo brCounting to ten: $aCounter\n;
  $aCounter++;
  RecursiveFunction($aCounter);
  }
 }
?

- Original Message - 
From: Kevin Gordon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 25, 2003 7:49 AM
Subject: [PHP-DB] Calling functions recursively


 Can functions / methods be called recursively? If so how can this be
 done? Comments much appreciated.
 Kevin Gordon
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 



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