Connecting Tech Pros Worldwide Forums | Help | Site Map

collecting data from forms - when to save

Newbie
 
Join Date: Sep 2006
Posts: 10
#1: Sep 24 '06
--------------------------------------------------------------------------------

when do i write my data to the data base?

i am building a browser based image map generator using php. each time an image is clicked the coords and a text box contents are to be saved somehow. i am expecting upto 50 lines of data for each image (x coord, y coord and text) :

sample data:
image name x y description
image7.jpg 123 123 wheel
image7.jpg 485 688 tyre
image7.jpg 456 595 bolt

later on i will display the image and create the hotspots image map with the text data (description) as html alt tags.

i have a data table in MYSQL with 4 columns:
1 image name
2 x_coord
3 y_coord
4 text for alt tags

do i collect 50 sets of data in a temp file or array or something and then write it to the database in one go or write each line of data as it is created ? my worry is that if i write to the database it may be a pain to edit any mistakes. so maybe some kind of preview table might be a good idea....

ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#2: Sep 24 '06

re: collecting data from forms - when to save


Why are you posting the same thread in 2 different forums???? Don't you think other people also have a right for attention?

Ronald :cool:
Newbie
 
Join Date: Sep 2006
Posts: 10
#3: Sep 24 '06

re: collecting data from forms - when to save


Quote:

Originally Posted by ronverdonk

Why are you posting the same thread in 2 different forums???? Don't you think other people also have a right for attention?

Ronald :cool:

hi, did not know if this was php or a sql question ! thanks for your attentions if it was of no constructive value.

regards

john
Reply