Todd Cary wrote:
No doubt I am over looking something very simple, nevertheless I am baffled by not being able to connect to a MySQL DB.

Here is the code that will use the Class:


    if ($retval) {
      echo "Success<br>";
      if (mysql_select_db($database)) echo "Selected";
      else echo "Cannot select";
    else echo "Failed";
    $cal=new CALEVENTS();

The commented out debug code (my debugging) works fine...connects!

This code in the Class produces an error:

        function CALEVENTS($host="",$user="",$password="",$database="")

        function setInfo($host,$user,$password,$database)
//echo $this->host . "<br>";  for debugging
//echo $this->user . "<br>";
//echo $this->password . "<br>";
//echo $this->database . "<br>";

       // Error produced here!!

This is the error:

Warning: mysql_connect(): Access denied for user 'apache'@'localhost' (using password: NO) in /home/httpd/calendar/calendarevents/php/ on line 42
Found the error!  The open is called twice!

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to