Re: problem in connecting to mysql from php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Hello everyone,
> 
> I am in the process of learning php and I was trying to connect to a mysql
> database on my own computer(localhost). I have done the following as
> prerequisites:
> 
> copied the dll files in system32
> removed the semicolon(;) from extension=php_mysqli.dll

You should NOT need to move the .dll at all. There is a
setting in the ini which tells PHP where to look for extensions and that
should have pointed to the original location. Hence, removing the
semicolon should be the only part necessary.

> In spite of doing the above when I try to run the following :
> 
> <?php
> $db = new MySQLi('localhost', 'root', 'Password123', 'test');
> $sql = 'SELECT * FROM a123';
> $result = $db->query($sql);
> 
> while($row = $result->fetch_object()) {
>     echo '<div>' . $row->name . '</div>';
> }
> 
> $db->close();
> ?>
> 
> I get the error: *Fatal error*: Class 'MySQLi' not found in *C:\Program
> Files\Apache Software Foundation\Apache2.2\htdocs\a.php* on line *2
> 
> *Please guide me as to how can I get rid of this error?
> 
> Regards,
> Kushal



--
Niel Archer
niel.archer (at) blueyonder.co.uk


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux