QuickBooks/Driver/Sql.php
public function select($table, $restrict, $order = array(), $offset = null, $limit = null)
	{
		$list = array();

		if (count($restrict))
		{
			$where = array();
			foreach ($restrict as $field => $value)
			{
				$where[] = $field . " = '" . $this->_escape($value) . "' ";
			}

			$where = " WHERE " . implode(' AND ', $where) . " ";
		}
		else
		{
			$where = "";
		}

		$orderby = "";
		if (is_array($order) and
			count($order))
		{
			$orderby = array();

			foreach ($order as $field => $direction)
			{
				$orderby[] = " " . $field . " " . $direction;
			}

			$orderby = " ORDER BY " . implode(', ', $orderby);
		}

		$errnum = 0;
		$errmsg = '';
		if ($res = $this->_query("SELECT * FROM " . $this->_escape($table) . " " . $where . " " . $orderby, $errnum, $errmsg, $offset, $limit))
		{
			while ($arr = $this->_fetch($res))
			{
				$list[] = $arr;
			}
		}

		return $list;
	}
public function select($table, $restrict, $order = array(), $offset = null, $limit = null)
	{
		$list = array();

		if (count($restrict))
		{
			$where = array();
			foreach ($restrict as $field => $value)
			{
				$where[] = $field . " = '" . $this->_escape($value) . "' ";
			}

			$where = " WHERE " . implode(' AND ', $where) . " ";
		}
		else
		{
			$where = "";
		}

		$orderby = "";
		if (is_array($order) and
			count($order))
		{
			$orderby = array();

			foreach ($order as $field => $direction)
			{
				$orderby[] = " " . $field . " " . $direction;
			}

			$orderby = " ORDER BY " . implode(', ', $orderby);
		}

		$errnum = 0;
		$errmsg = '';
		if ($res = $this->_query("SELECT * FROM " . $this->_escape($table) . " " . $where . " " . $orderby, $errnum, $errmsg, $offset, $limit))
		{
			while ($arr = $this->_fetch($res))
			{
				$list[] = $arr;
			}
		}

		return $list;
	}
Get a list of objects back from the database

@param string $table
@param array $restrict