selectArray() function missing in subsystems/database/mysql.php
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Exponent Content Management System |
Fix Committed
|
High
|
Unassigned |
Bug Description
This kills all pure MySQL installations for no reason, simply add the following function to the file:
/* exdoc
* Select a record from the database as an array
*
* Selects a set of arrays from the database. Because of the way
* Exponent handles objects and database tables, this is akin to
* SELECTing a set of records from a database table. Returns an
* array of arrays, in any random order.
*
* @param string $table The name of the table/object to look at
* @param string $where Criteria used to narrow the result set. If this
* is specified as null, then no criteria is applied, and all objects are
* returned
*/
function selectArray($table, $where = null, $orderby = null, $is_revisioned=
if ($where == null) $where = "1";
if($is_
$orderby = empty($orderby) ? '' : "ORDER BY " . $orderby;
$arrays = array();
$res = @mysql_
if ($res == null) return null;
return mysql_fetch_
}
Changed in exponent-cms: | |
status: | New → Fix Committed |
Also the following functions are missing:
function selectObjectByS ql($sql) { query($ this->connectio n,$sql) ; object( $res);
$res = @mysql_
if ($res == null) return null;
return mysql_fetch_
}
function selectObjectsBy Sql($sql) {
$res = @mysql_query($sql, $this->connection);
$objects = array(); rows($res) ; $i++) $objects[] = mysql_fetch_ object( $res);
return $objects;
if ($res == null) return array();
for ($i = 0; $i < mysql_num_
}
function queryRows($sql) { query($ this->connectio n,$sql) ; rows($res) ;
$res = @mysql_
return empty($res) ? 0 : mysql_num_
}