LAB 09 - INSERT IMAGE USING BLOB DATA TYPES
Assalamualaikum and hai!
For the last lab session, which is lab 09 tutorial session, we are required to continue the previous lab 08 with insert image by using the BLOB data types. This is the last lab tutorial for this subject WWW Programming.
In this database, the content that i insert is as below:
Thats all for this lab 09 tutorial session. See again on next post on FINAL PROJECT WWW PROGRAMMING! Thanks for viewing this post and my previous post before this. Enjoy your day!~
In this database, the content that i insert is as below:
The step to insert the image for blob/longblob data type is as follow:
1. Insert new column after DOB table.
2. Name it as "IMAGE", choose the longblob/blob data types.
3. Then import any image from download file into the image database column.
Here i show some example on the coding for Home page php file:
<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>Welcome to SAMPLE </strong></font></p>
<p>
<?php
$connect=mysql_connect('localhost','root','');
if ($connect)
{ echo "Successfully connected to MySQL server -localhost-<p>"; }
else
{ die ( "Could not connect to MySQL " .mysql_error() ); }
$select=mysql_select_db("mydomain");
if ($select)
{ echo "Successfully selected database -mydomain-<p>"; }
else
{ die("Unable to select database. ".mysql_error() ); }
?>
</p></td>
</tr>
</table>
<font color="#FFFFFF"></font>
</body>
</html>
Assalamualaikum W.B.T. :)
Comments
Post a Comment