Povezivanje PHP-a i MySQl-a

Ukoliko želite da povežete PHP i MySQL koristite sledeći kod. Zamenite korisničke podatke sa podacima koje ste dobili od nas.

$mysql_host = "mysqlserver.loopia.se";   /* Set the correct database name such */
$mysql_user = "mojekorisničkoime";
$mysql_password = "mojalozinka";
$mysql_database = "mojabaza";
$mysqli = new mysqli( $mysql_host, $mysql_user, $mysql_password, $mysql_database );
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}

Was this article helpful?

Related Articles