Re: Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class (using CRUD)
| From: | David Robley | Date: | Sat, 16 Feb 2013 02:28:44 +0000 |
| Subject: | Re: Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class (using CRUD) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-320228@lists.php.net to get a copy of this message | ||
dealTek wrote:
>
> Thanks for all the help folks,
>
>
> PHP-light-PDO-Class
>
> ok well I found this...
>
> https://github.com/poplax/PHP-light-PDO-Class
>
> But it does not seem to recognize the port - I put the port as 8889 but
> keeps saying can't connect port 3306
>
> Warning: PDO::__construct() [pdo.--construct]: [2002] Connection refused
> (trying to connect via tcp://127.0.0.1:3306) in
> /Users/revdave/Sites/php-fool/pdo3/PHP-light-PDO-Class-
master/class.lpdo.php
> on line 33 Connection failed: SQLSTATE[HY000] [2002] Connection refused
>
> BTW: I tried to add the port a few places but it didn't work......
>
>
> How do we fix this?
>
>
>
> ------ config.php
>
> <?php
> $config = array();
> $config['Database'] = array();
> $config['Database']['dbtype'] = 'mysql';
> $config['Database']['dbname'] = 'tester';
> $config['Database']['host'] = '127.0.0.1';
> $config['Database']['port'] = 8889;
> $config['Database']['username'] = 'root';
> $config['Database']['password'] = 'root';
> $config['Database']['charset'] = 'utf8';
> ?>
Change host to localhost - your mysql may be configured not to accept
requests via tcp.
>
> =============== class.lpdo.php
<SNIP>
>
>
> --
> Thanks,
> Dave - DealTek
> dealtek@gmail.com
> [db-3]
--
Cheers
David Robley
My karma ran over my dogma