How to link an image map with a database?

Asked By 460 points N/A Posted on -
qa-featured

Hello fellows,


How to link an image map with a database? I am using PHP programming language for my upcoming website project about mapping and determining specific location. I’m just wondering how to link the map to the database? I am using MySQL database system. Your answers are very much welcome.


Regards,

Benjamin.

SHARE
Answered By 0 points N/A #92390

How to link an image map with a database?

qa-featured

Hi Benjamin,

First store image in table, define column as long blob type then upload your image, open it  read the contents from mysql escape all the special characters

mysql_escap_string() after then insert in the table

whenever you want to see your image write your PHP page which can perform so then reference it in your image like

<img src="myimage server.php?imageid=5324">

myimageserver.php will headers output which is followed by contents of longblob column in table for example

header("Content-Type: image/jpegn");
header("Content-Transfer-Encoding: binary");
echo $row['imageblob'];

Related Questions