> 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? >> >> CREATE TABLE image ( >> 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) ? >***Chetan writes:Actually the DB table 'finddoc' holds data for all fields except the 'image' field. In this field, right now, it only holds the reference to the web folder where the images are stored. All the doctors images are in the same folder. The problem is my job is to bring all the profiles up to the current level of doctors in the hospital. We have close to 300 doctors right now working. This is the reason I was thinking of actually putting the images in the DB. However, whatever is easier and just as effective. Please let me know if this has any bearing on your unexpected and excellent observation of using the web server's file folders. You might want to check out the web site as it is now. Only a small percentage of the doctors are listed and not many photo's at all. http://www.aimshospital.org/findadoc/find-a-doctor.php?id=47 > > 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. > > --Thank you for your quick and to the point reply. I have something to consider an about face in the design! Chetan > Postgresql & php tutorials > http://www.designmagick.com/ > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php