Re: [PHP-DB] problem in connecting to mysql from php
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
Re: [PHP-DB] problem in connecting to mysql from php
create a file with phpinfo() and make sure mysqli is listed in the loaded modules On Tue, Jun 14, 2011 at 12:07 PM, Niel Archer n...@chance.now wrote: 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 -- *Share with free mind!* Join I.T professionals on http://www.tuwana.com For Web development and design http://abahjoseph.com Follow me on Twitter http://twitter.com/freefazee Mobile: *+2348066100671*
[PHP-DB] problem in connecting to mysql from php
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 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
Re: [PHP-DB] problem in connecting to mysql from php
Okay. I tried using that too. If I run this: ?php $link = mysql_connect('localhost', 'root', 'Password123'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($link); ? I get the error: *Fatal error*: Call to undefined function mysql_connect() in *C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\a.php* on line *2 *I think there is something wrong with my configuration. On Mon, Jun 13, 2011 at 6:00 PM, mrfroasty mrfroa...@gmail.com wrote: Your error message is about class not found.That means there is no class named MySQLi.Please use a textbook with online manual http://www.php.net/manual/en/ref.mysql.php On 06/13/2011 02:08 PM, C0mf0rtably Numb wrote: 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 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 -- Extra details: OSS:Gentoo Linux profile:x86 Hardware:msi geforce 8600GT asus p5k-se location:/home/muhsin language(s):C/C++,PHP,SQL,HTML Typo:40WPM url:http://www.mzalendo.net url:http://www.zanbytes.com
Re: [PHP-DB] problem in connecting to mysql from php
On 13 June 2011 13:26, C0mf0rtably Numb 08.kus...@gmail.com wrote: Okay. I tried using that too. If I run this: ?php $link = mysql_connect('localhost', 'root', 'Password123'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($link); ? I get the error: *Fatal error*: Call to undefined function mysql_connect() in *C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\a.php* on line *2 *I think there is something wrong with my configuration. On Mon, Jun 13, 2011 at 6:00 PM, mrfroasty mrfroa...@gmail.com wrote: Your error message is about class not found.That means there is no class named MySQLi.Please use a textbook with online manual http://www.php.net/manual/en/ref.mysql.php On 06/13/2011 02:08 PM, C0mf0rtably Numb wrote: 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 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 -- Extra details: OSS:Gentoo Linux profile:x86 Hardware:msi geforce 8600GT asus p5k-se location:/home/muhsin language(s):C/C++,PHP,SQL,HTML Typo:40WPM url:http://www.mzalendo.net url:http://www.zanbytes.com Copying the files to windows\system ... what files? Where were you told to do this? Normally the extension files you need for PHP are in C:\PHP5\ext (or PHPx). I've never copied a single file into my Windows folder for PHP. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php