Sot do te ju mesoj se si te bejme nje error page kur MySQL serveri na del offline
Pra ndiqni hapat e mij dhe besoj se do te keni suskes
1. Se pari e krijojme nje HTML page te rreje me emrin noconnection.html
Dhe ne ate dokument futni kete kod dhe e ruani ne (public_html):
Kodet PHP:
<HTML>
<HEAD>
<TITLE>Couldn't connect to MySQL database!!</TITLE>
<style type="text/css">
.error {color: red; font-family: Arial; font-size: 20px;}
</style>
</HEAD>
<BODY>
<p align="center">
<span class="error">
Couldn't Connect To MySQLdatabase! Please Try Again Latter
</span>
</p>
</BODY>
</HTML>
Pas ketij hapi shkoni ne file-n Config.php dhe ndodh qe ky file quhet (Config.php-db-info.php)
ose kerkoni per FIle-n i cili permban informacionet per kyqjen ne Databaz .
Do te dukej diqka e ngjashem me kete :
Kodet PHP:
<?php
$dbhost = "localhost";
$dbname = "name";
$dbuname = "datapass user name";
$ppass = "the secret word";
$connectdb=mysql_connect($dbhost,$dbuname,$ppass);
$xx=@mysql_select_db($dbname,$connectdb);
?>
Shtojani ne rreshtin mysql_select_db rreshti i cili permban :
Kodet PHP:
@mysql_select_db($dbname,$connectdb);
if (!$xx) {
include ("noconnection.html");
exit();
}
File-i config.php do te duket keshtu :
Kodet PHP:
<?php
$dbhost = "localhost";
$dbname = "name";
$dbuname = "datapass user name";
$ppass = "the password";
$connectdb=mysql_connect($dbhost,$dbuname,$ppass);
$xx=@mysql_select_db($dbname,$connectdb);
if (!$xx) {
include ("noconnection.html");
exit();
}
?>
Tani nese serveri juaj MySQL del offline kjo faqe do te paraqitet.
Eshte nje error mjaft i perhapun neper servera Free .