Re: Probably a dumb question but I'm new to PEAR.
| From: | Stig S. Bakken | Date: | Wed, 20 Mar 2002 18:18:54 +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-1004@lists.php.net to get a copy of this message | ||
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.
Drop the semicolon from the end of the query and see if that helps.
- Stig