Jump to content

Multidimensional array with php and mysql


raj76

Recommended Posts

Hi All,

 

I am making a daily time report management using php and mysql.The database table is created.

 

Now I have to make a html table like below using php and mysql:

 

HTML Code:

 

timeslots            User1          User2      User3       User4    
8-9                      work           work       work        work

9-10                

10-11

...
...
...

17-18

 

8,9,10 are the hours and it will be static.User1..2..3 are coming from the database.and the work done in hour 8 or 9 or 10...will also come from the database for that user.

 

I think here i have to apply 3 dimensional array containing hours and users and work done for that hours.I have all the data stored in the db but the problem is how can i keep the hours,users and work done in a multidimensional array and to display it in the above way.

 

Please suggest any hint as starting point.

 

Thanks,

Raj

Thanks premiso for the array structure.

 

Sorry for late reply.....Can you please tell me if I use array_push function to insert the db values in the array...

 

Also should I start with time then user and then work...can you show me a simple example of how values are manipulated in multidimensional arrays plz.

 

Thanks,

raj

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.