Esempio n. 1
0
$BranchRecord['ContactPersonName']['Value'] = 'ContactPersonName';
$BranchRecord['PhoneNumber']['Value'] = '(012)2311234';
$BranchRecord['FaxNumber']['Value'] = '(012)2311234';
$BranchRecord['Longitude']['Value'] = '123.4567';
$BranchRecord['Latitude']['Value'] = '123.4567';
$BranchBase->update('Branch', 'id', 1, $BranchRecord);
if ($dbBaseClass->conn) {
    echo "Connection established.<br />";
} else {
    echo "Connection could not be established.<br />";
    die(dbGetErrorMsg());
}
// Using dbQuery
echo '<h2>Using dbQuery</h2>';
$sql = "SELECT TOP(10) Name FROM company";
$stmt = $dbBaseClass->dbQuery($sql);
if ($stmt === false) {
    die(dbGetErrorMsg());
}
while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {
    echo $row['Name'] . ", " . "<br />";
}
sqlsrv_free_stmt($stmt);
// Using getAll
echo '<h2>Using getAll</h2>';
$stmt = $dbBaseClass->getAll('Company');
if ($stmt === false) {
    die(dbGetErrorMsg());
}
while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {
    echo $row['Name'] . ", " . "<br />";