Welcome Guest, Not a member yet? Register   Sign In
Unable to connecte to the database
#3

MySQLi Test Script:

PHP Code:
<?php

DEFINE 
('DB_HOST''database_host');       // The database host ie: loacalhost etc;
DEFINE ('DB_USER''user_name');           // The database users name- root
DEFINE ('DB_PASSWORD''user_password');   // The database password - xxxxxx
DEFINE ('DB_NAME''database_name');       // The database name - my_database

// Connect to the MySQLi Database
$conn mysqli_connect(DB_HOSTDB_USERDB_PASSWORDDB_NAME);

// Check for a MySQLi Connection
if (mysqli_connect_errno())
{
 
   echo "Failed to Connect to MySQL: " mysqli_connect_error();
}
else
{
 
  echo "Connection to MySQLi Ok! " mysqli_connect_error();
}

mysqli_close($conn);

?>
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
Unable to connecte to the database - by rooye - 06-08-2016, 08:41 AM
RE: Unable to connecte to the database - by InsiteFX - 06-09-2016, 03:16 AM
RE: Unable to connecte to the database - by rooye - 06-09-2016, 07:50 AM
RE: Unable to connecte to the database - by rooye - 06-09-2016, 07:43 AM
RE: Unable to connecte to the database - by rooye - 06-09-2016, 08:00 AM
RE: Unable to connecte to the database - by rooye - 06-09-2016, 12:49 PM
RE: Unable to connecte to the database - by rooye - 06-09-2016, 01:47 PM
RE: Unable to connecte to the database - by rooye - 06-10-2016, 05:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB