Esempio n. 1
0
    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 />";
}
sqlsrv_free_stmt($stmt);
// Using getAllByFieldname
echo '<h2>Using getAllByFieldname</h2>';
$stmt = $dbBaseClass->getAllByFieldName('Company', 'Name', 'Protea Security');
if ($stmt === false) {
    die(dbGetErrorMsg());
}
while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {
    echo $row['Name'] . ", " . "<br />";
}
sqlsrv_free_stmt($stmt);
// Using getFieldsByFieldname
echo '<h2>Using getFieldsByFieldname</h2>';
$fields = array('Name', 'CompanyCode');
$stmt = $dbBaseClass->getFieldsByFieldName('Company', 'Name', 'Protea Security', $fields);
if ($stmt === false) {
    die(dbGetErrorMsg());
}
while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {