I've been working on a problem all afternoon, and I couldn't figure out what was going on. My query results were always return the first column of my tables and nothing more. I finally descided to look into the database class that was being used and found an interesting bit of code.
/**
* Not sure why this is here either.
*
* @param string $query
* @param boolean $cache Use Memcache
* @param int $ttl Memcached's expiration time in seconds
*/
public function customQuery ( $query , $cache = false , $ttl = 300 )
{
return $this -> query ( $query , $cache , $ttl );
}
///
/**
* Queries the database for a mysql result set link or the processed result set.
*
* @param string $query The query to execute
* @param string $method The method to fetch the result set link with
* @param boolean $multiple If there are multiple rows to be fetched
* @param boolean $cache Use Memcache
* @param int $ttl Memcached's expiration time in seconds
*
* @return mixed The mysql result set link or the processed result set, depending on weather or not $method was passed.
*/
public function query ( $query , $method = false , $multiple = false , $cache = false , $ttl = 300 )
{
/// Trimmed
}
- /**
- * Not sure why this is here either.
- *
- * @param string $query
- * @param boolean $cache Use Memcache
- * @param int $ttl Memcached's expiration time in seconds
- */
- public function customQuery ( $query , $cache = false , $ttl = 300 )
- {
- return $this -> query ( $query , $cache , $ttl );
- }
- ///
-
- /**
- * Queries the database for a mysql result set link or the processed result set.
- *
- * @param string $query The query to execute
- * @param string $method The method to fetch the result set link with
- * @param boolean $multiple If there are multiple rows to be fetched
- * @param boolean $cache Use Memcache
- * @param int $ttl Memcached's expiration time in seconds
- *
- * @return mixed The mysql result set link or the processed result set, depending on weather or not $method was passed.
- */
- public function query ( $query , $method = false , $multiple = false , $cache = false , $ttl = 300 )
- {
- /// Trimmed
- }
-
As far as I am aware you can't do this in PHP. It doesn't care what name you give a variable, parameters are always assigned in order. Am I correct on this or have I been missing something all these years.
#define NULL (::rand() % 2)