Example #1
0
function x4sqlInsSet($table)
{
    $raw = json_decode(gp('x4c_insset'));
    $colnames = array_shift($raw);
    foreach ($raw as $onerow) {
        $row = array_combine($colnames, $onerow);
        x4sqlIns($table, $row);
    }
}
Example #2
0
function index_hidden_x4DB()
{
    // For all raw access, there will be an array
    // of column values, and a table to hit.
    $row = rowFromGP('x4c_');
    // values
    $whr = rowFromGP('x4w_');
    // where clause values
    $table = gp('x4Page');
    // The table name
    $rr = gp('retrow', 0);
    // row return command
    // There are four different database functions, so there
    // are four library routines we might call.
    $ra = $r1 = false;
    switch (gp('db')) {
        case 'del':
            x4sqlDel($table, $whr);
            break;
        case 'sel':
            x4sqlSel($table, $whr);
            break;
        case 'ins':
            x4sqlIns($table, $row, $rr);
            break;
        case 'upd':
            x4sqlUpd($table, $row, $whr, $rr);
            break;
    }
}