<body><!--
ปรับปรุง : 2549-06-01
ประกอบด้วย uploadpage.htm, uploadprocess.php และ download.php
Source from http://php.dreamwerx.net/forums/viewtopic.php?t=6
-->
<table width=100%>
<td valign=top bgcolor=#dddddd><b>Image Upload in MySQL<br>so MySQL : required</b></td><td>
<form method="post" action="uploadprocess.php" enctype="multipart/form-data">
ส่งภาพ .jpg .gif .png เข้า Server<br>
<input type="file" name="file1" size="20">
<input type="submit" name="submit" value="submit">
</form>
<hr color=red>
<form method="get" action="download.php">
Image ID : <input name="id" size="20" value=1>
<input type="submit" name="submit" value="download.php">
<br>มีข้อมูลแล้ว ระหว่าง 1 ถึง 3
</form>
<hr color=red>
<img src=download.php?id=1>
<br><img src=download.php?id=1>
</td></table>
<pre><font size=4><b>SQL for 2 Table Creating in TEST Database</b><ul>
CREATE TABLE file (
id mediumint(8) unsigned NOT NULL auto_increment,
datatype varchar(60) NOT NULL default 'application/octet-stream',
name varchar(120) NOT NULL default '',
size bigint(20) unsigned NOT NULL default '1024',
filedate datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (id) ) TYPE=MyISAM;
CREATE TABLE filedata (
id mediumint(8) unsigned NOT NULL auto_increment,
masterid mediumint(8) unsigned NOT NULL default '0',
filedata blob NOT NULL,
PRIMARY KEY (id),
KEY master_idx (masterid) ) TYPE=MyISAM ;
</ul></pre>
จำนวน : 38 บรรทัด