Exemplo n.º 1
0
/** 
Retrieves a list of Developer
@order = Optional, can be an array of keys or just a single key to order by the results
@limit = Optional
*/
function list_developer($order = null, $limit = null)
{
    global $__db_conn;
    $sql = "SELECT * FROM developer";
    if ($order != null) {
        $order_str = $order;
        if (is_array($order)) {
            $order_str = implode(",", $order);
        }
        $sql .= " order by {$order_str}";
    }
    if ($limit != null) {
        $sql .= " limit {$limit}";
    }
    $result = mysql_query($sql, $__db_conn);
    $results = array();
    while ($row = mysql_fetch_assoc($result)) {
        $tmp = new Developer();
        $tmp->load_from_array($row);
        $results[] = $tmp;
    }
    return $results;
}