+ Reply to Thread
Results 1 to 3 of 3

Thread: Problem with mysqli() ....... help required please

  1. #1
    reubenn is offline x10Hosting Member reubenn is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    2

    Problem with mysqli() ....... help required please

    hey ppl, Im a newbie here, as also to web-design.

    I have a database named
    reuben_headfirst

    and a added a user named
    reuben_killer

    This user has all privileges to the same database

    now in my php code,I have the following line

    Code:
    $dbc = mysqli_connect( 'iammmband.x10.mx', 'reuben_killer', thePassword , 'reuben_headfirst' );
    I get the the following warning when I try to access my site.

    Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2003): Can't connect to MySQL server on 'iammmband.x10.mx' (111) in /home/reuben/public_html/index.php



    What's the problem ? Please help me,I really want to put up this site....
    Thanks in advance.

    Am I supposed to give my x10-log in username and password ? Or am am I on the right track?

    Here's the code in its entirety:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Mismatch - Where opposites attract!</title>
      <link rel="stylesheet" type="text/css" href="style.css" />
    </head>
    <body>
      <h3>Mismatch - Where opposites attract!</h3>
    
    <?php
      require_once('appvars.php');
      require_once('connectvars.php');
    
      // Generate the navigation menu
      echo '❤ <a href="viewprofile.php">View Profile</a><br />';
      echo '❤ <a href="editprofile.php">Edit Profile</a><br />';
    
      // Connect to the database 
      $dbc = mysqli_connect( 'iammmband.x10.mx', 'reuben_killer', thePassword , 'reuben_headfirst'); 
    
      // Retrieve the user data from MySQL
      $query = "SELECT user_id, first_name, picture FROM mismatch_user WHERE first_name IS NOT NULL ORDER BY join_date DESC LIMIT 5";
      $data = mysqli_query($dbc, $query);
    
      // Loop through the array of user data, formatting it as HTML
      echo '<h4>Latest members:</h4>';
      echo '<table>';
      while ($row = mysqli_fetch_array($data)) {
        if (is_file(MM_UPLOADPATH . $row['picture']) && filesize(MM_UPLOADPATH . $row['picture']) > 0) {
          echo '<tr><td><img src="' . MM_UPLOADPATH . $row['picture'] . '" alt="' . $row['first_name'] . '" /></td>';
        }
        else {
          echo '<tr><td><img src="' . MM_UPLOADPATH . 'nopic.jpg' . '" alt="' . $row['first_name'] . '" /></td>';
        }
        echo '<td>' . $row['first_name'] . '</td></tr>';
      }
      echo '</table>';
    
      mysqli_close($dbc);
    ?>
    
    </body> 
    </html>

  2. #2
    gomarc's Avatar
    gomarc is offline x10 Elder gomarc is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    USA
    Posts
    511

    Re: Problem with mysqli() ....... help required please

    Hi reubenn,

    Replace your Host/Server name to simply 'localhost'

    Code:
    $dbc = mysqli_connect('localhost', 'reuben_killer', thePassword , 'reuben_headfirst' );
    You can find more information searching the forums and in the x10Hosting Knowledgebase (http://x10hosting.com/kb/questions.php?questionid=15)

  3. #3
    reubenn is offline x10Hosting Member reubenn is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    2

    Re: Problem with mysqli() ....... help required please

    Thankyou soooooooo much

+ Reply to Thread

Similar Threads

  1. MySQLi connection
    By as4s1n in forum Programming Help
    Replies: 1
    Last Post: 03-16-2010, 11:14 PM
  2. MySQLi support?
    By streek dime in forum Free Hosting
    Replies: 1
    Last Post: 08-18-2009, 12:57 PM
  3. Mysqli Extension
    By austinw in forum Free Hosting
    Replies: 1
    Last Post: 04-22-2009, 02:01 PM
  4. mysqli not available
    By Eclipse4 in forum Free Hosting
    Replies: 2
    Last Post: 08-13-2008, 12:18 AM
  5. MySQLi extention?
    By lambada in forum Free Hosting
    Replies: 3
    Last Post: 07-04-2007, 05:49 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers