Esempio n. 1
0
            $params2 = array('p1' => 3, 'p2' => 4);
            $col = 'ID';
            $setup = true;
            break;
        case 'db2':
            $strsql0 = 'select * from contacts where id IN (?, ?)';
            $params = array(1, 3);
            $params2 = array(2, 4);
            $col = 'ID';
            $setup = true;
            break;
        case 'sqlsrv':
            $strsql0 = 'select * from contacts where id IN (?, ?)';
            $params = array(1, 3);
            $params2 = array(2, 4);
            $col = 'id';
            $setup = true;
            break;
    }
    //*****************************************************
    // Are We Setup? Run Tests.
    //*****************************************************
    if ($setup) {
        print_array(qdb_exec($data_source, $strsql0, $params, $col, $qdba_opts));
        print_array(qdb_exec($data_source, $strsql0, $params2, $col, $qdba_opts));
    } else {
        print div($no_setup_msg, array('class' => 'message_box no_setup'));
    }
} else {
    print div($no_bind_msg, array('class' => 'message_box notice'));
}
Esempio n. 2
0
$data1->data_query($strsql1);
//------------------------------------------------
// Insert Row #2
//------------------------------------------------
if ($tmp_debug) {
    qdb_list($data_source, $strsql2, false, $qdba_opts);
} else {
    qdb_list($data_source, $strsql2);
}
//------------------------------------------------
// Insert Row #3
//------------------------------------------------
if ($tmp_debug) {
    qdb_exec($data_source, $strsql3, $params, false, $qdba_opts);
} else {
    qdb_exec($data_source, $strsql3, $params);
}
//------------------------------------------------
// Insert Row #4
//------------------------------------------------
//print_array($test_vals[3]);
$contact = new contact(false);
$contact->use_bind_params();
$contact->import($test_vals[3]);
$print_only = false;
if ($print_only && $tmp_debug) {
    $contact->print_only();
    print $contact->save();
    $contact->dump('data');
} else {
    $contact->save();
Esempio n. 3
0
$affect_rows = $data1->execute(array('issss', 10, 'bob', 'bobson', 'Toowalk', 'MN'));
//-----------------------------------------------------------
// "qdb_list()"
//-----------------------------------------------------------
//$data1->execute(array('issss', 11, 'john', 'smith', 'Racine', 'WI'));
qdb_list($data_source, "\n\tinsert into contacts \n\t\t(id, first_name, last_name, city, state) \n\t\tvalues \n\t\t(11, 'john', 'smith', 'Racine', 'WI')\n");
//-----------------------------------------------------------
// "qdb_exec()"
//-----------------------------------------------------------
//$data1->execute(array('issss', 12, 'todd', 'tomom', 'Where', 'FL'));
$id = 12;
$fname = 'todd';
$lname = 'tomrom';
$city = 'Where';
$state = 'FL';
qdb_exec($data_source, $strsql2, array('issss', &$id, &$fname, &$lname, &$city, &$state));
//-----------------------------------------------------------
// "DIO"
//-----------------------------------------------------------
//$data1->execute(array('issss', 13, 'ricky', 'richards', 'Here', 'OH'));
// Create New Object
$contact = new contact(false);
$contact->use_bind_params();
$contact->set_field_data('id', 13);
$contact->set_field_data('first_name', 'ricky');
$contact->set_field_data('last_name', 'richards');
$contact->set_field_data('city', 'Here');
$contact->set_field_data('state', 'OH');
//$contact->print_only();
//print $contact->save();
$contact->save();