note 46791 rejected from function.mysql-connect by nlopess
| From: | nlopess@php.net | Date: | Sat, 23 Oct 2004 11:29:18 +0000 |
| Subject: | note 46791 rejected from function.mysql-connect by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78994@lists.php.net to get a copy of this message | ||
Note Submitter: mndeaves at hotmail dot com
----
Hi there,
I am trying to use an adapted version of the code posted by caleg. I am using the code in a simple
forum which runs perfectly on a windows machine under apache 2 and php 4.
However, this code does not run under mac os x with the default apache build from apple and apache
5. Whenever I try to access a database I always get the error : no database selected.
Is this because I run PHP 5 on my mac?
Here is the first part of my code....
<?
class BlogUser
{
function BlogUser()
{
$this->host = "localhost";
$this->db = "blog";
$this->user = "";
$this->pass = "";
$this->link = mysql_connect($this->host, $this->user, $this->pass)or
die("Database Connection Error: ".mysql_error());
mysql_select_db($this->db, $this->link);
register_shutdown_function(array(&$this, 'close'));
}