Current Path : /web/htdocs/www.entinoprofit.org/home/admin/
Upload File :
Current File : /web/htdocs/www.entinoprofit.org/home/admin/db.php

<?
class SortableExample {
    var $conn; /* protected */
    var $user = 'Sql97522'; /* protected */
    var $pass = 'c7d497e7'; /* protected */
    var $dbname = 'Sql97522_1'; /* protected */
    var $host = '62.149.150.52'; /* protected */

    function __construct() {
        $this->conn = mysql_connect($this->host, $this->user, $this->pass);
        mysql_select_db($this->dbname,$this->conn);
    }

    function getList($nome) {
        $sql = "SELECT * FROM priority WHERE nome = '$nome' ORDER BY ord";
        $recordSet = mysql_query($sql,$this->conn);
        $results = array();
        while($row = mysql_fetch_assoc($recordSet)) {
            $results[] = $row;
        }
        return $results;
    }

    function updateList($orderArray) {
        $orderid = 1;
        foreach($orderArray as $catid) {
            $catid = (int) $catid;
            $sql = "UPDATE priority SET ord={$orderid} WHERE id={$catid}";
            $recordSet = mysql_query($sql,$this->conn);
            $orderid++;
        }
    }

    function SortableExample()  /* PHP 4 constructor */
    {
        // call php5 constructor
        $args = func_get_args();
        call_user_func_array(array(&$this, '__construct'), $args);
    }
}
?>