what's the most efficient way??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lisawebs
Forum Commoner
Posts: 44
Joined: Wed Nov 19, 2003 6:21 pm

what's the most efficient way??

Post by lisawebs »

I'd appreciate your comments on this:

Have a table where key is date, and containing #peoplea
I get all the records and put them in an array(date and #people)

The user can only:
change #people
or create new entries to the array (date and # people)

When accepting the page, the process must
a) update all existing records (matching dates in the array)
with the new #people value
b) create records that don't exist (new entries in the array)

Well, basically I should divide existing data than new entries,
and issue 2 sql statements (for update and for create)

Question:
Since the #people for each record is different,
I wonder if I could pass in the sql statement
an entire array with the record key (date) and the #people

thanks
Post Reply