Re: PEAR::DB accessing a MS SQL (SQL SERVER) DB Instance

From: Date: Thu, 13 Nov 2003 23:05:16 +0000
Subject: Re: PEAR::DB accessing a MS SQL (SQL SERVER) DB Instance
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8895@lists.php.net to get a copy of this message
Hi, Your code does work, though the table 'tbl_indiv' must be one you created in the Northwind databese. Extension not found indicates that the system is unable to fing php_mssql.dll. The file should be in the same directory as your other php binaries or in the directory specified by the extension_dir setting in php,.ini - Frank > All, > > I'm having a hard time accessing a SQL Server instance using PEAR. I'm using > PHP 4.3.4 and Apache 1.3.2 on a Win2k Professional workstation. I'm trying > to access a SQL Server instance on a remote server using PEAR. When the code > executes, I receive an error reading DB Error: extension not > found. I > don't know what that really means. Is my PEAR install screwed? Is it a > connection issue? Here is my code (see below). If have any tips, I'd > appreciate it. > > <?php > require_once ('DB.php'); > > $user = 'dev01'; > $pass = 'devdev'; > $host = 'db_dev'; > $db_name = 'Northwind'; > > $dsn = "mssql://$user:$pass@$host/$db_name"; > > $sql = 'SELECT * FROM tbl_indiv'; > > $cnn = DB::connect($dsn); > if (DB::isError($cnn)) { die('<B>DB Connection:</B> ' . $cnn->getMessage()); > } > > $q = $cnn->query($sql); > if (DB::isError($q)) { die('<B>Exec query: </B> ' . $q->getMessage()); } > > echo '<TABLE><TR><TD>First Name</TD><TD>Last > Name</TD></TR>'; > > while ($q->fetchInto($row)) { > printf("<TR><TD>%s</TD><TD>%s</TD></TR>", > $row[1], $row[2]);} > > $cnn->disconnect(); > ?> > > Regards, > Adam Fortuno (x4904) > <<Adam Fortuno (E-mail).vcf>> > >

« previous php.pear.general (#8895) next »