PHP MySQL Book Borrowing App Guide
PHP MySQL Book Borrowing App Guide
Student
Book
StudentCode Integer
Name Text Entire Code
0,n Borrow 0,n
First name Text Title Text
Address Text DateEmprunt Date Author Text
Class Text Date Edition Date
▪ In the folder TP6, create the file [Link] containing the code below
below:
<?php
$idcon=mysqli_connect("localhost" ,"root", "");
if($idcon)
{
Connection successful <br/>
$okbd=mysqli_select_db($idcon ,"biblio");
if($okbd==TRUE)
<br/>Correct base <br/>
else
<br/>Base incorrect <br/>
}
else
Connection error with the server:<br/>
?>
Nabil REJEB 1
ENSIT WEB WORKSHOP
In the folder TP6, create the file [Link] containing the code
following:
<?php
$okdec=mysqli_close($idcon);
if($okdec)
Logout successful <br/>
else
Failed to disconnect <br/>
?>
III. Insertion:
[Link]éparer leformulaire d’insertion d’un étudiant: ([Link])
2. In the page new Etud_action.php add the code below and test it:
Nabil REJEB 2
ENSIT ATELIERWEB
IV. Suppression:
1. Prepare the student deletion form: ([Link])
V. Modification:
1. Prepare the student modification form: ([Link])
Nabil REJEB 3
ENSIT ATELIERWEB
VI. Selection:
1. Prepare the [Link] next, allowing to display the list
students:
The code:
<body>
<?php
$idcon=mysqli_connect("localhost", "root", "");
$okbd=mysqli_select_db($idcon, "biblio");
$request="select * from student";
$res= mysqli_query($idcon, $requet);
?>
<table border="2">
<tr>
<th> Code </th>
<th> Name </th>
First Name
Address
Class
</tr>
<?php
while($line=mysqli_fetch_array($res))
{
?>
<tr>
<td><?php echo $row[0]; ?></td>
<td><?php echo $line[1]; ?></td>
<td><?php echo $line[2]; ?></td>
<td><?php echo $line[3]; ?></td>
<td><?php echo $line[4]; ?></td>
</tr>
<?php
}
mysqli_close($idcon);
?>
</table>
</body>
Nabil REJEB 4
ENSIT ATELIERWEB
Nabil REJEB 5
ENSIT ATELIERWEB
X. Index:
We end with [Link], the home page of the management application.
library
Nabil REJEB 6