from mssql.class.php:
Code: Select all
//query the database
function query($query) {
try {
$this->result = @mssql_query($query, $this->linkId);
if (! $this->result)
throw new Exception("The query failed. Check your syntax.");
}
catch (Exception $e) {
die($e->getMessage());
}
return $this->result;
}
//put the results into a usable array
function fetchArray() {
$array = @mssql_fetch_assoc($this->result);
return $array;
}Code: Select all
//run the query
$sqlDb->query("SELECT * NAMES");
while ($results = $sqlDb->fetchArray()) {
//print_r($results);
echo ("$results->NAME <br />");
}