01.
<?php
02.
$connect
= mysqli_connect(
"localhost"
,
"root"
,
""
,
"finalproject2018"
);
03.
$query
=
"SELECT * FROM boatdb"
;
04.
$result
= mysqli_query(
$connect
,
$query
)
or
die
(
"Error: "
. mysqli_error(
$connect
)); ;
05.
06.
if
(isset(
$_GET
[
'id'
])){
07.
08.
$id
= mysql_real_escape_string(
$_GET
[
'id'
]);
09.
$query
= mysql_query(
"SELECT * FROM boatdb WHERE boat_id = '$boat_id' "
);
10.
11.
while
(
$row
= mysql_fetch_assoc(
$query
))
12.
{
13.
14.
$imageData
=
$row
[
"img"
];
15.
16.
}
17.
18.
header(
"content-type : image/jpeg"
);
19.
echo
$imageData
;
20.
21.
}
22.
23.
24.
25.
?>
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
<img src=
"img_view.php?boat_id=45"
>