SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: sql error

  1. #1
    SitePoint Enthusiast bail's Avatar
    Join Date
    Feb 2010
    Location
    walsall westmidlands
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sql error

    hi everyone my name is bail
    i am on chapter four of the build your own database driven website the 4th edition
    i am geting an error when i copy the code from the book it is connecting to the database but there is error before it

    here is the error:

    Warning: mysqli_connect() [function.mysqli-connect]: Headers and client library minor version mismatch. Headers:50051 Library:50148 in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\connect\index.php on line 3

    Database connection established.

    here is the code im using:

    <?php

    $link = mysqli_connect('localhost', 'root', 'bailuk');
    if (!$link)

    {
    $output = 'Unable to connect to the database server.';
    include 'output.html.php';
    exit();
    }

    if (!mysqli_set_charset($link, 'utf8'))

    {
    $output = 'Unable to set database connection encoding.';
    include 'output.html.php';
    exit();
    }

    if (!mysqli_select_db($link, 'ijdb'))

    {
    $output = 'Unable to locate the joke database.';
    include 'output.html.php';
    exit();
    }

    $output = 'Database connection established.';
    include 'output.html.php';
    ?>

    could any one help please im new to php and mysql thanks
    bail

  2. #2
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That isn't a mysql error, it is a php error. you need to update either your PHP or Apache install.

  3. #3
    SitePoint Enthusiast bail's Avatar
    Join Date
    Feb 2010
    Location
    walsall westmidlands
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for your reply but the problem i have is i can only get thses two versions to run togther from the book install?
    thanks bail


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •