Checking
Nowplay
around with
database
PHP
syntaxdone!!!
Before that,
create a folder
name phpweb
in htdocs
folder
Databases
Existing RDBMS libraries in PHP (located in php.ini file)
MySQL
MS SQL Server
Oracle
Postgre SQL
SQLite
Firebird
Databases
How about other RDBMS?
MySQL
Its a FREE RDBMS (http://www.mysql.com)
Commonly used with PHP
How to manage your database?
mysql_pconnect()
Now, create 1
folder in htdocs.
Rename the folder
to phpweb
Use Notepad or
Dreamweaver to
write PHP codes
Save as
dbconn.php
inside
htdocs/phpweb/
if(isset($dbconn)){
mysql_select_db($dbname, $dbconn) or die("<center>Error: " .
mysql_error() . "</center>");
}
else{
echo "<center>Error: Could not connect to the database.</center>";
}
?>
10
11
12
13
15
16
17
}
}
mysql_close($dbconn);?>
20
Save as
login0.php
inside phpweb
folder
21
22
23
24
Break
Next, lets go to
search process
25
29
30
Save as
search0.php
inside phpweb
folder
Break
Next, lets go to
update and delete
processes
31
Simply create a
menu page using
Notepad/Dreamwe
aver
32
inside phpweb
folder
Checking
These are PHP files that supposedly you have created
during lab session
a) dbconn.php
b) register.php => register0.php
c) login.php => login0.php =>
menuAdmin.php/menu.php => logout.php
d) search.php => search0.php => process0.php
Checking
1.
2.
3.
4.
5.
35
The End
36