SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: IDK what to do

  1. #1
    SitePoint Member
    Join Date
    Apr 2012
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Publishing MySQL Data on the Web

    PHP Code:
    <?php
    $link 
    mysqli_connect ('localhost''root''nestle324');
    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';
    ?>
    I keep getting this error:

    Fatal error: Call to undefined function mysqli_connect() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\connect\index.php on line 2

  2. #2
    SitePoint Guru Jason__C's Avatar
    Join Date
    Oct 2009
    Location
    Racoon City
    Posts
    660
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Not an expert at PHP, but shouldn't there be no space between "t" and "("? Just a shot.
    Chuck Norris is so tough,
    mosquitos ask for permission before they bite him

  3. #3
    SitePoint Member
    Join Date
    Apr 2012
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by USPaperchaser View Post
    Not an expert at PHP, but shouldn't there be no space between "t" and "("? Just a shot.
    I tried that already

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    I have this online on my website. http://www.ryanreese.us/asdf.php

    There's no error coming up. What version of PHP are you running? The only thing I changed was the database login details.

    Edit-I moved the file from the base, into the root. So you can't get to it. But it basically only says the error about the joke database not being able to be selected. Which, if I gave it my database name, it wouldn't have that issue.
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  5. #5
    SitePoint Member
    Join Date
    Apr 2012
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    I have this online on my website. http://www.ryanreese.us/asdf.php

    There's no error coming up. What version of PHP are you running? The only thing I changed was the database login details.

    Edit-I moved the file from the base, into the root. So you can't get to it. But it basically only says the error about the joke database not being able to be selected. Which, if I gave it my database name, it wouldn't have that issue.
    Apache/2.2.22 (Win32) PHP/5.2.17

    What is the base and Root (the what you see when you open a file)?

  6. #6
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    try changing all the "mysqli" statements to "mysql"

    if no luck make a php file with the statement

    phpinfo();

    run that and post the results here.
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  7. #7
    SitePoint Guru bronze trophy TheRaptor's Avatar
    Join Date
    Jul 2011
    Location
    New York
    Posts
    710
    Mentioned
    40 Post(s)
    Tagged
    0 Thread(s)
    Since you have two threads on the same topic, to keep the discussion easier to keep track of, I'm closing this thread.

    Please continue the discussion in your other thread here.

    THREAD CLOSED.
    TheRaptor - Joe


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
  •