An example of a script to connect to the MySQL database:
For correct functionality of the database connection must be in stringu in the specification of the database server used:
< name-database >. dbaserver.net
If you are using to log on to the database IP address, you must edit it according to the above example, as in the case of migration of the database on a different server connection to the database is no longer work.
<?php
$link=mysql_connect(<název-databáze>.dbaserver.net, "nazev_uzivatele", "heslo")
or die ("Could not connect: ".mysql_errno().": ".mysql_error()."<BR>");
print ("Connected successfully");
mysql_select_db("nazev_databaze");
// .....další příkazy a dotazy na databázi
mysql_close($link);
?>