Ignore:
Timestamp:
Jan 18, 2004, 11:06:34 PM (21 years ago)
Author:
z0rglub
Message:

Simplifying concatenation of $infos variables to select in the database

Location:
branches/release-1_3/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/release-1_3/include/config.inc.php

    r294 r297  
    6868                'comments_forall','authorize_cookies','mail_notification' );
    6969
    70 $query  = 'SELECT ';
    71 foreach ( $infos as $i => $info ) {
    72   if ( $i > 0 ) $query.= ',';
    73   $query.= $info;
    74 }
     70$query  = 'SELECT '.implode( ',', $infos );
    7571$query.= ' FROM '.PREFIX_TABLE.'config;';
    7672
  • branches/release-1_3/include/user.inc.php

    r295 r297  
    2828                'long_period', 'template', 'forbidden_categories' );
    2929
    30 $query_user  = 'SELECT ';
    31 foreach ( $infos as $i => $info ) {
    32   if ( $i > 0 ) $query_user.= ', ';
    33   $query_user.= $info;
    34 }
     30$query_user = 'SELECT '.implode( ',', $infos );
    3531$query_user.= ' FROM '.PREFIX_TABLE.'users';
    3632$query_done = false;
Note: See TracChangeset for help on using the changeset viewer.