src/Nether/Database.php
public function QueryOld($fmt,$parm=null) {
	/*//
	@depreciated obviously
	@return Nether\Database\Query;
	builds a query using pdo's bound parameter stuff.
	//*/

		//echo "<p>{$fmt}</p>";

		// if given a Database\Query object and an object for the parameters then
		// fetch the named args in the query and find their matching properties
		// in the parm object.
		if(is_object($fmt) && (is_object($parm)||is_array($parm))) {
			$qarg = [];
			$parm = (object)$parm;

			foreach($fmt->GetNamedArgs() as $arg) {
				if(property_exists($parm,$arg)) $qarg[":{$arg}"] = $parm->{$arg};
				else if(property_exists($parm,":{$arg}")) $qarg["{$arg}"] = $parm->{":{$arg}"};
			}

			$parm = $qarg;
		}

		else {
			// if parm is not an array then build it as an array from all the
			// arguments that were passed to the method.
			if(!is_array($parm))
			$parm = array_slice(func_get_args(),1);
		}

		// try to prepare the statement.

		$qtime = microtime(true);

		if(!($statement = $this->Driver->prepare($fmt)))
		throw new \Exception('SQL statement was unable to be prepared.');

		// hand over a query object.
		$result =  new Nether\Database\Result($this->Driver,$statement,$parm);

		static::$QueryTime = microtime(true) - $qtime;
		static::$QueryCount++;

		return $result;
	}
public function QueryOld($fmt,$parm=null) {
	/*//
	@depreciated obviously
	@return Nether\Database\Query;
	builds a query using pdo's bound parameter stuff.
	//*/

		//echo "<p>{$fmt}</p>";

		// if given a Database\Query object and an object for the parameters then
		// fetch the named args in the query and find their matching properties
		// in the parm object.
		if(is_object($fmt) && (is_object($parm)||is_array($parm))) {
			$qarg = [];
			$parm = (object)$parm;

			foreach($fmt->GetNamedArgs() as $arg) {
				if(property_exists($parm,$arg)) $qarg[":{$arg}"] = $parm->{$arg};
				else if(property_exists($parm,":{$arg}")) $qarg["{$arg}"] = $parm->{":{$arg}"};
			}

			$parm = $qarg;
		}

		else {
			// if parm is not an array then build it as an array from all the
			// arguments that were passed to the method.
			if(!is_array($parm))
			$parm = array_slice(func_get_args(),1);
		}

		// try to prepare the statement.

		$qtime = microtime(true);

		if(!($statement = $this->Driver->prepare($fmt)))
		throw new \Exception('SQL statement was unable to be prepared.');

		// hand over a query object.
		$result =  new Nether\Database\Result($this->Driver,$statement,$parm);

		static::$QueryTime = microtime(true) - $qtime;
		static::$QueryCount++;

		return $result;
	}
public function QueryOld ( $ fmt , $ parm = null ) { /*//
	@depreciated obviously
	@return Nether\Database\Query;
	builds a query using pdo's bound parameter stuff.
	//*/ //echo "<p>{$fmt}</p>"; // if given a Database\Query object and an object for the parameters then // fetch the named args in the query and find their matching properties // in the parm object. if ( is_object ( $ fmt ) && ( is_object ( $ parm ) || is_array ( $ parm ) ) ) { $ qarg = [ ] ; $ parm = ( object ) $ parm ; foreach ( $ fmt -> GetNamedArgs ( ) as $ arg ) { if ( property_exists ( $ parm , $ arg ) ) $ qarg [ ":{$arg}" ] = $ parm -> { $ arg } ; else if ( property_exists ( $ parm , ":{$arg}" ) ) $ qarg [ "{$arg}" ] = $ parm -> { ":{$arg}" } ; } $ parm = $ qarg ; } else { // if parm is not an array then build it as an array from all the // arguments that were passed to the method. if ( ! is_array ( $ parm ) ) $ parm = array_slice ( func_get_args ( ) , 1 ) ; } // try to prepare the statement. $ qtime = microtime ( true ) ; if ( ! ( $ statement = $ this -> Driver -> prepare ( $ fmt ) ) ) throw new \ Exception ( 'SQL statement was unable to be prepared.' ) ; // hand over a query object. $ result = new Nether \ Database \ Result ( $ this -> Driver , $ statement , $ parm ) ; static :: $ QueryTime = microtime ( true ) - $ qtime ; static :: $ QueryCount ++ ; return $ result ; }
by better things.
by better things .