Re: Probably a dumb question but I'm new to PEAR.

From: Date: Wed, 20 Mar 2002 16:13:04 +0000
Subject: Re: Probably a dumb question but I'm new to PEAR.
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-992@lists.php.net to get a copy of this message
The problem is obvious. =) Just remove ; from the SQL query. A ; is only used in SQL clients to separate queries, API's only permit one query per function call (unless they have made their own support for ; as most clients have). On Wed, 2002-03-20 at 16:42, Malcolm Turnbull wrote: > > Howdy, > > I'd like to set up an intranet system that can use either a PostGreSQL > backend (prefered) or a MSSQL7 one if I run in to trouble( being a newbie to > PostGreSQL).. > > PHP postgres functions work fine, but I'd like to use PEAR DB to make life > easier (Ha!) > > I'm running Mandrake 7.1, PHP 4.06 & PostGreSQL 7.2 > I've grabbed the PEAR files from the latest PHP 4.1.2 tar ball (as mandrake > doesn't include them) > and put them in the include path.. > > Now I've tested : > > $db=DB::connect($dsn); > > and this connects fine with no errors. > > $db->disconnect(); > > also works fine... > > BUT anything inbetween causes a parser error ? > > i.e. > $sql=("select * from users2;"); > $result=$db->query($sql); > > will cause PARSE ERROR on line..... > > > What am I doing wrong ? > > Thanks in advance. > > > Regards, > Malcolm Turnbull > www.crocus.co.uk - For all your Garden Needs > www.stealthinventory.com - The Open Source Software Audit Tool > > 01344 629661 > 07715 770523 > > > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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