$items = $DB_site->query_first ( "SELECT * FROM items_user WHERE userid=$bbuserinfo['userid']" ) ; for ( $x = 0; $x <= 50; $x++ ) : $item = "item" . $x ; $points = "points" . $x ; $desc = "description" . $x ; if ( $items["$item"] ) : $update[] = "$item = 'No Item'" ; endif ; if ( $items["$points"] ) : $update[] = "$points = '0'" ; endif ; if ( $items["$desc"] ) : $update[] = "$desc = 'No Description Available'" ; endif ; endfor ; if ( sizeof ( $update ) > 0 ) : $DB_site->query ( "UPDATE items_user SET " . implode ( ", ", $update ) . " WHERE userid=$bbuserinfo[userid]" ) ; endif ;