PDA

View Full Version : Fatal error: Call to undefined function: odbc_connect()


NPeart1
12-20-2005, 08:21 AM
I'm having a tough time resolving this error when connecting to an SQL database (Fatal error: Call to undefined function: odbc_connect()). Does anyone have any suggestions?

Here's my code:

<?


$db = odbc_connect("PowerPad","","") or die ( "Could not make connection to database");
$sql = "SELECT * from PPAD.Team ORDER BY Name";
$result = odbc_exec($db, $sql);


$a=0;
while ($row = odbc_fetch_array($result)) {

if ($a%3==0) {
echo "<TR bgColor=#ffffff>";
}
echo "<TD vAlign=top height=21>";
echo "<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">";
echo "$row[0]";
echo "</font><br>";
echo "<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">";
echo "$row[1]";
echo "</font><br>";
echo "<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">";
echo "<a href=mailto:".$row[5].">".$row[5]."</a>";
echo "</font><br>";
echo "<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">";
echo "$row[3]";
echo "</font><br>";
$a++;
}
odbc_close($db);
?>