help with mysqli

Discussion in 'PHP' started by gf049, Apr 12, 2008.

  1. #1
    Hi,

    I'm new to php. I recently installed php 5.2.5 and Apache 2.2.8, I also have had a MySQL 5 installed, my OS is Windows XP. I followed the installation instructions of php and apache, and they both seem to work.

    Next, I worte up a piece of php script to connect to MySQL:

    <?php
    $db = new mysqli('localhost','root','rootroot,'home');
    if (mysqli_connect_errno()) {
    echo '<p>*** Failed connecting to database';
    } else {
    echo '<p>Successfully connected to database';
    $db->close();
    }
    ?>

    when I run this script apache complained:

    Fatal error: Class 'mysqli' not found in C:\Apache2.2\htdocs\index.php on line 14

    I google'd on this error msg and corrected a few things based on the results:
    • I put C:\Apache2.2 in the Path environment
    • I copied libmysql.dll, php_mysql.dll, and php_mysqli.dll to system32
    • I set extension_dir in php.ini to point to "ext" (also tried to point to the absolute path)
    • I uncommented extension=php_mysql.dll and extendion=php_mysqli.dll in php.ini
    But still I run into the same error!
    Any ideas what I did wrong or miss?

    Thanks!
     
    gf049, Apr 12, 2008 IP
  2. BigJim21

    BigJim21 Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    trying getting wamp instead of installing them one at a time then there should be no issues

    also i havent seen anyone try to connect with new mysqli befor i always use mysql_connect() never have any issues
     
    BigJim21, Apr 12, 2008 IP