Hello mailing list, I try to connect SQL server from ODBC through PEAR, but it doesn't
work, this is the code:
<html><head><title>Test DB Class - PEAR</title></head>
<body>
<table border=1>
<tr><th>Estado</th></tr>
<?php
//connect
require_once('DB.php');
$db =DB::connect("odbc://[EMAIL PROTECTED]/testmssql"); // testmssql is the DSN
if (DB::iserror($db)) {
die($db->getMessage());
}
//issue the query
$sql ="SELECT * from tablaEstado";
$q =$db->query($sql);
if (DB::iserror($q)) {
die($q->getMessage());
}
//generate table
while ($q->fetchInto($row)) {
?>
<tr><td><?= $row[0] ?></td></tr>
<?php
}
?>
</table>
</body></html>
this is the output
DB Error: connect failed
If any could give me hand, I will aprecciate, thanks, bye.