Complex Array/INSERT INTO problem

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
oscardog
Forum Contributor
Posts: 245
Joined: Thu Oct 23, 2008 4:43 pm

Complex Array/INSERT INTO problem

Post by oscardog »

So i have 42 fields, doesnt matter what is in the field, just that they are max 250chars long.

It is not manditory to enter into each field, so say i enter data into 8 fields i'll use the strlen to check each field(Or is there a better way of doing this?)

Then the fields that have values i want to submit to a MySQL database. BUT here lies the problem, each field has an associated 'time' (so imight of put data into 8:00, 9:00, 16:00 and 18:00) and i want to submit to the database... 'id, user_id, date, time, entry' (Now the user_id is fine, and the id is auto increment) but the others i have absolutely no idea how to insert.

I was thinking of using an Array, but say i want to submit the data, how do i associate '8:00' with the entry? Gah confused..

Hope you get it :S

Oscardog
oscardog
Forum Contributor
Posts: 245
Joined: Thu Oct 23, 2008 4:43 pm

Re: Complex Array/INSERT INTO problem

Post by oscardog »

Really need this help guys...

Oscardog
Post Reply