Web Analytics Made Easy -
StatCounter Why PEAR DB::Connect keeps returning NULL? - CodingForum

Announcement

Collapse
No announcement yet.

Why PEAR DB::Connect keeps returning NULL?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why PEAR DB::Connect keeps returning NULL?

    Hi,
    I am using Easyphp, and Maguma as IDE/debugger. When I step through my code, I found that the following code:

    $dsn = "mysql://{$username}:{$password}@{$hostName}/{$databaseName}";

    $connection = DB::connect($dsn);

    $connection keeps getting NULL. Why? I checked the mysql error log, there is no error. I double checked all names for host and username and password, and they are correct. I checked the manual for the return value of DB::connect, but it mentions nothing about NULL.

    How to fix it?

    Many thanks.

  • #2
    How are youy determining that $connection is NULL?

    Comment


    • #3
      I set a breakpoint right after the 2nd line of code, and look at the $connection variable.

      Originally posted by Kid Charming
      How are youy determining that $connection is NULL?
      Last edited by dealmaker; Jul 30, 2005, 01:57 PM.

      Comment


      • #4
        Are you using is_null() to check or some other function?

        Comment


        • #5
          ok, found the problem, Maguma Studio sucks. It seems that Maguma studio shows NULL for all objects!!! It's not really null, but it just shows all objects as null in watch.

          Don't use Maguma, it's very stupid.

          Originally posted by Kid Charming
          Are you using is_null() to check or some other function?

          Comment

          Working...
          X