/pear/DB.php (with mssql)... docs? examples? usage help? thx!!
| From: | Dickerson, Monty | Date: | Mon, 30 Apr 2001 18:18:50 +0000 |
| Subject: | /pear/DB.php (with mssql)... docs? examples? usage help? thx!! | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-7164@lists.php.net to get a copy of this message | ||
Howdy! Is anybody using class DB.php (distributed in the pear directory of
every php4 distribution)? If so, please point me to some documentation and
examples of this well written class! I'm having trouble using it;
When I run the following code ... >>
<?php
include_once('DB.php');
$db = DB::connect(mssql://user:pw@host/mydb');
$stmt = $db->prepare('SELECT * FROM Schools');
$result = $db->execute($stmt);
$row = $db->fetchrow($result);
// while($row = $db->fetchrow($result)) {
foreach( $row as $field => $value ) {
echo "$field: $value<br>\n";
}
// }
$db->disconnect();
?>
The output is ... >>
error_message_prefix:
error_prepend:
error_append:
mode: 1
level: 1024
code: -1
message: DB Error: unknown error
debuginfo: SELECT * FROM Schools
callback:
And I do have Mssql client 7 installed on my machine;
'host' is a DNS name of the server computer, right?...
thx,
monty