Beruflich Dokumente
Kultur Dokumente
0 and MySQL 5
Configuration for Windows Platform Guide
Software used:
• Apache HTTP Server v2.2.3
• PHP v5.3.0
• MySQL v5
Just extract the PHP ZIP file downloaded from the site
http://www.php.net to the dir
C:/PHP
LoadModule php5_module
"C:/php/php5apache2_2.dll"
PHPIniDir "C:/php"
AddType application/x-httpd-php .php
Caution:
Finally:
<html>
<head>
<title>MySQL PHP Connection test</title>
</head>
<body bgcolor="gray" text="white">
<center>
<?php
echo "Hello.............”
$conn = mysql_connect("localhost", "user_name",
"password");
if(!$conn)
die("<p>Connection to MySQL is failed due to <b>“.
mysql_error()
. "</b> </p>");
Echo "successfully Connected to MySQL<br />";
$db = mysql_select_db("db_name", $conn);
if(!$db)
die("<p><b>" . mysql_error() . "</b></p>");
echo "successfully Connected to MySQL Database<br />";
mysql_close($conn);
echo "Connection to MySQL is Successfully closed";
?>
</center>
</body>
</html>