i'm new here and doing some project,
how can i connect to my database in db4free.net from php, i have tried this
<?php
$host = "db4free.net/mainbookstore";
$user = "***";
$pass = "****";
$database = "mainbookstore";
$conn = mysql_connect($host, $user, $pass);
if ($conn) {
$buka = mysql_select_db ($database);
if (!$buka) {
die ("Database tidak dapat dibuka");
}
} else {
die ("Server MySQL tidak terhubung");
}
?>
but get error Such no host, but in my java use :
dataSource.setUrl("jdbc:mysql://db4free.net:3306/mainbookstore");
i can connect to my database. Thanks before :)