why show not connected in my phpdatabase. why is my incorrect? my database code are
please help me
it depends. but try the following code:
$server = "sqlXXX.epizy.com";
$user = "epiz_XXXXXXXX";
$pass = "XXXXXXXX";
$database = "epiz_XXXXXXXX_YYYY";
$db = new \\PDO( "mysql:host=$server;port=3306;dbname=$database;charset=utf8", $user, $pass );
$sth = $db->prepare( "select 'this comes from mysql' as response" );
$data = ;
while ( $row = $sth->fetch( PDO::FETCH_ASSOC ) )
$data = $row;
just replace the first 3 variables with the data provided in your CP and the 4th line with the database name you should have created.
until you make it work, keep fiddling with the variables. once it works for you, check your own code for what’s missing.