LAB 07 - ADD IMAGE
Assalamualaikum and hai!
Questions:
On this lab 07 tutorial, it will be based on previous Lab 06 which need to :
-> add ONE field in the table for image/pic/photo normally PNG/JPG-formatted.
-> add record for more than 5 records, 10 would be nice :D
->make sure the images can be added, deleted, updated and displayed.
Output:
STEP TO DO LAB 07:
1. Add new row for IMAGE in the previous lab 06.
2. Insert an embed link into PHPMyAdmin database.
How to embed a link of image/video?
1. Choose any image/video in search engine.
2. Copy the image/video link.
3. Open "http://embed.ly/code" link and paste any image/video link.
4. Embed the image/video.
5. Copy the embed link and paste it into the PHPMyAdmin database.
3. Don't forget to change and add the coding in all PHP files in order to print out all the new database from image.
<html>
<head>
<title>List of Users</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="80%" height="339" border="1" align="center" bordercolor="#000000">
<tr bordercolor="#FFFFFF">
<td width="80" rowspan="3" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> </td>
<td height="104" colspan="5" align="center" valign="top" bordercolor="#000000"><img src="baner.jpg" width="800" height="100"></td>
<td width="80" rowspan="3" align="center" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="23" colspan="5" align="center" valign="top" bordercolor="#000000" bgcolor="#FFCC66"><div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
:: <a href="home.php">HOME</a>
:: <a href="listAll.php">list of users</a>
:: <a href="register.php">register</a>
:: <a href="deleteList.php">delete user</a>
:: <a href="editList.php">edit user</a>
:: <a href="searching.php">search user</a>
::</font></div></td>
</tr>
<tr>
<td height="202" colspan="5" align="center" valign="top" bordercolor="#000000" bgcolor="#FFCC66">
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>List of Registered Users </strong></font></p>
<p>
<?php
// error_reporting(E_ALL ^ E_DEPRECATED);
$connect=mysql_connect('localhost','root','');
mysql_select_db('mydomain');
$SQLcommand = "SELECT * FROM people";
$result = mysql_query($SQLcommand, $connect);
print "<table width=\"500\">";
print "<tr bgcolor=\"#DDDDDD\">";
print "<td>ID</td>";
print "<td>Name</td>";
print "<td>Telephone</td>";
print "<td>DOB</td>";
print "<td>Image</td>";
print "</tr>";
while($row = mysql_fetch_row($result))
{
print "<tr bgcolor=\"#EEEEEE\">";
print "<td> $row[0] </td>";
print "<td> $row[1] </td>";
print "<td> $row[2] </td>";
print "<td> $row[3] </td>";
print "<td> $row[4] </td>";
print "<td>";
print "<a href =\"viewUser.php?ID=";
print $row[0] ;
print "\">";
print "[view]";
print"</a>";
print "</td>";
// print "<td> position: $row[6] </td>";
print "</tr>";
}
print "</table>";
mysql_close($connect);
?>
</p></td>
</tr>
</table>
<font color="#FFFFFF"></font>
</body>
</html>
****The highlighted code are the coding that need to be added in all the php files.
That all for this lab 07 tutorial session. We'll continue in the next lab 08 tutorial session. Enjoy your day and have fun in your own way!
Assalamualaikum W.B.T. :)
Comments
Post a Comment