For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > November 2004 > Re: [PEAR] PHP5 and PEAR DB class









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] PHP5 and PEAR DB class
Paul Dubois

2004-11-29, 4:04 pm

Victor Menendez wrote:
> Does anyone know for sure that PEAR DB class does currently work with PHP5 and Mysql 4.1?
>
> I received the following error;
> Error: "Non-static method DB::connect() should not be called statically" (error #2048).
>
> I know that this is a commong problem, is it just a matter for declaring a public class and calling hte DB method differently?


Works for me, with either the mysql or mysqli drivers.

PEAR 1.3.3.1
DB 1.6.8
PHP 5.0.2

There is a bug in the PHP mysqli extension that causes it to fail if
there's no socket file in the connect string. This patch fixes it:

--- mysqli_nonapi.c.orig 2004-09-04 09:19:20 -05:00
+++ mysqli_nonapi.c 2004-10-18 15:12:45 -05:00
@@ -49,6 +49,10 @@
return;
}

+ if (!socket_len) {
+ socket = NULL;
+ }
+
/* TODO: safe mode handling */
if (PG(sql_safe_mode)){
} else {


The patch is in the current CVS, but I don't think it's in any
released version. 5.0.3, perhaps.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com