Jump to content

Can't connect to mysql


Wei

Recommended Posts

Yes apache is running on the same machine.

I've tested like this

<!DOCTYPE html> 
<html> 
<body> 
  
<h1>My first PHP page</h1> 
  
<?php 
echo "Hello World!"; 
// Create connection 
$con=mysqli_connect("localhost","root","","rgaming"); 
  
// Check connection 
if (mysqli_connect_errno()) 
  { 
  echo "Failed to connect to MySQL: " . mysqli_connect_error(); 
  } 
?> 
  
</body> 
</html> 
  

Yes mysql server is running localy

Link to comment
  • 1 month later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...