Exemplo n.º 1
0
function reOrderItems($tabl, $ar_where, $indx, $ordr, $sortby, $start, $inc)
{
    $strng = "SELECT {$indx},{$ordr} FROM {$tabl} ";
    if ($wh_str = where_list($ar_where)) {
        $strng .= " WHERE {$wh_str} ";
    }
    $orderby = $sortby ? " ORDER BY {$sortby} " : " ORDER BY {$ordr} ";
    $strng .= "{$orderby} ;";
    $rX = newQuery($strng, 0);
    $ar = pg_fetch_assoc($rX);
    $v = $start;
    while ($ar) {
        $rU = newQuery("UPDATE {$tabl} SET {$ordr}={$v} WHERE {$indx}=" . $ar["{$indx}"], 0);
        pg_free_result($rU);
        $v += $inc;
        $ar = pg_fetch_assoc($rX);
    }
    pg_free_result($rX);
}
Exemplo n.º 2
0
 function sqlSubset()
 {
     return where_list($this->ar_subset);
 }