Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8873235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:24:51+00:00 2026-06-14T18:24:51+00:00

I try to echo my database (hosted on ipage.com) using php and I get

  • 0

I try to echo my database (hosted on ipage.com) using php and I get this error : Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, cgiadmin@yourhostingaccount.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

What is wrong? $mysqli = new mysqli("site.ipagemysql.com", "user", "pass", "database");
alone, works, so it is not a error in the connection right? or I have to contact the host?

My code

<?php

    $mysqli = new mysqli("site.ipagemysql.com", "user", "pass", "database");

    /* check connection */ 
    if (mysqli_connect_errno()) {
        printf("Connect failed: %s\n", mysqli_connect_error());
        exit();
    }
    printf("Host information: %s\n", $mysqli->host_info);

    $result = mysqli_query($link, "SELECT DATABASE()")) 
    $row = mysqli_fetch_row($result);
    printf("Default database is %s.\n", $row[0]);
    mysqli_free_result($result);
    ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:24:52+00:00Added an answer on June 14, 2026 at 6:24 pm

    You have one ) too many on line 12, it’s missing a semicolon and you haven’t changed the $link variable to correspond with the $mysqli variable on line 3.

    $result = mysqli_query($mysqli, "SELECT DATABASE()");
    

    Also, you’re mixing object oriented style with procedural style. I’d recommend you to use OO style only. So the code would be:

    <?php
        $mysqli = new mysqli("site.ipagemysql.com", "user", "pass", "database");
    
         /* check connection */ 
        if (mysqli_connect_errno()) {
            printf("Connect failed: %s\n", mysqli_connect_error());
            exit();
        }
        printf("Host information: %s\n", $mysqli->host_info);
    
        $result = mysqli->query("SELECT DATABASE()")) 
        $row = $result->fetch_row();
        printf("Default database is %s.\n", $row[0]);
        $result->close();
        $mysqli->close();
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error when I try recreate tables in my database with hibernate.
try: html = urlopen('http://glbse.com/api/asset/' + asset.name) except: print 'error while updating the price of
I am getting an error when updating a database using PDO. I am new
Hi I am using a PHP script to connect to SQL Server 2005. After
I have an error when i try to connect my database. Error : SQLSTATE[HY093]:
How should echo output following query? My tables in MySQL database: $query = $this->db->query('SELECT
I get an error trying to connect to my mysql database, I'm quite a
Try this code - import java.io.StringReader; public class StringReaderTest { public static void main(String[]
Try this piece of code - public class WhitespaceTest { public static void main(String[]
try: recursive_function() except RuntimeError e: # is this a max. recursion depth exceeded exception?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.