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

  • Home
  • SEARCH
  • 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 6076261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:35:14+00:00 2026-05-23T10:35:14+00:00

Seems like this is a pretty common error, but I can’t work it out.

  • 0

Seems like this is a pretty common error, but I can’t work it out. I’m running PHP 5.3.1 towards an
external MySQL server 5.5.8 – both installed with Phpmyadmin and running Windows Server 2k8R2.

When I try the following:

   $connection = new mysqli("myhost.com:3306", "myUser", "myPwd", "myDB");
   $result = $connection->prepare("SELECT * FROM tt_staff
                           WHERE crew_type = ?
                           AND inaktiv_vakt = 0
                           ORDER BY ansvarlig_vakt DESC, crew_type, navn_vakt");
   $result->bind_param("s", $value);
   $result->execute();
   $result->bind_result($value, $name);

I get the ”
Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2005): Unknown MySQL server host (…)”

I made sure that the Mysqli is enabled in the php.ini on the DB-server, but that’s also all I’ve done as I’ve been told this should work out-of-the-box. Since this is the first time I’m working with prepared statements there very well might be a simple typo error in there some place.

  • 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-05-23T10:35:14+00:00Added an answer on May 23, 2026 at 10:35 am

    The problem is that MySQLi does not accept the port as part of the hostname but as a separate parameter. So I think this is how you should open your connection:

    $connection = new mysqli("myhost.com", "myUser", "myPwd", "myDB", "3306");
    

    Or perhaps, do not give the port at all because 3306 is the default one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems like it would be pretty common task, but I'm not having any
This seems like a pretty common problem, but I haven't found any sort of
This seems like a pretty softball question, but I always have a hard time
This seems like it should be pretty straight forward, but I'm apparently confused. I
This feels like it should be pretty simple, but not much seems to be
Seems like this should be obvious, but how do I send arrow key presses
Seems like this should be simple, but powershell is winning another battle with me.
It seems like this should be straightforward but I'm boggling. I've got my listview
I feel like this is a stupid question because it seems like common sense
Can this be done? It seems like this should be possible. In general, I

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.