2007-01-19 02:33:36 on a john loop question
( php )
  1  $i = 1;
2 foreach ($where as $column => $value) {
3 $query .= "$column='$value'" . ($i == $count ? '' : ' AND ');
4 $i++;
5 }


could become:
( php )
  1  $queryConditions = array();
2 foreach( $where as $column=>$value )
3 array_push( $queryConditions, "$column='$value'" );
4 $query .= implode( ' AND ', $queryConditions );


more letters to type, but conceptually nicer.
Leave a comment