Chetan Graham wrote:
Hi to All,

There is a page on our hospitals website where a patient can look at the
choice of different doctors with their credentials, publications, hobbies,
etc.Each doctor has or will have a 3-4KB jpeg image as well.

We are using MySQL5.0.2.7 with PHP5.2.1
My question concerns the following:
The existing table's fields with one for the image:

TABLE finddoc
id-int,not null, auto inc., unsigned,
name varchar(25),
desig varchar(30),
dept varchar(20),
email varchar(50),
image varchar(6000),
qualification varchar(100),
publications longtext,
areaofinterest longtext, not null,
achievements longtext not null,

My job is to develop a page where a admin user can create and edit
existing doctor profiles. My question is about the image uploading part.
I have a feeling the one field given to me for images is quite limited. Would it not be better to add another table with all the image info. such
as the following?

image_id int(10) unsigned NOT NULL auto_increment,
image_type varchar(50) NOT NULL default '',
image longblob NOT NULL,
image_size bigint(20) NOT NULL default '0',
image_name varchar(255) NOT NULL default '',
image_date datetime NOT NULL default '0000-00-00 00:00:00',
UNIQUE KEY image_id (image_id)

This will give greater control of the images or better manipulation of data.
If it is recommended by you php/mysql higher souls to add a table such as
this.  Then I have more questions.  Or perhaps the existing table is fine.
One might guess I inherited this project.

Do you need to store the image in the database (either for security reasons or something like replication) ?

Maybe it would be easier to store them in a folder for each doctor on the server directly rather than in the DB.

eg create a doctor_images/{doctor_id}/ folder and upload the images there.. then you don't have to worry about the db etc.

Postgresql & php tutorials

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to