|
1.
Setup PHP4 for Apache server in the MS Windows NT environment.
1. Download PHP
for MS Windows.
2. Unzip the Package to c:\php, now move php4ts.dll
to the windows/system32 directory.
3. Stop the Apache Webserver if it is running and edit
the httpd.conf.
# for the apache module
LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php
#for the cgi binary (you can use that one compiled with
force cgi redirect too)
ScriptAlias /php4/ "C:/php/"
Action application/x-httpd-php4 "/php4/php.exe"
AddType application/x-httpd-php4 .php
4. Copy the php.ini-dist to your system root (WINNT),
rename it to php.ini, and edit the php.ini to fit your
needs.
5. Restart the Apache server.
2.
PHP4 MySQL; Basic Connectivity.
PHP provides the
mysql_connect() function to create a connection to a
MySQL database server with three string arguments.
$connection = mysql_connect("www.ekoo.com","username","password");
3.
PHP4 MySQL; Sample database Query.
<HTML>
<HEAD>
<TITLE>Databse Connection Test</TITLE>
</HEAD>
<BODY>
<?
$connection
= mysql_connect("www.ekoo.com","username","password")
or exit();
mysql_delect_db ("databasename"
or exit();
$result =mysql_query("SELECT
COUNT(*) FROM EMPLOYEE") or exit();
mysql_free_result($result);
?>
</BODY>
</HTML>
|