|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Compare columns in table..big problem!
Hello everybody!
I am using Php Apache and Mysql! Well what I am trying to do is really difficult I guess. I have a table of a month with 31 fields for the month of Jan. I have a set of predefined values which are represented via numbers ranging from 1-10. For the dates in this month of January, if I want to assign values, I key in the numbers in the fields from 1-10. What I exactly want to do is, based on the numbers entered for different dates, I want to dynamically construct a table with colspans such that they represent the values over days <table> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> and goest to <td>31</td> </tr> //This part has to be dynamic let's say the value are like shown below: I am just choosing 2 variations i.e 1 & 2 it could up to 20 and the colspan has to be automatic showing the values... Jan_1 = 1 Jan_2 = 1 Jan_3 = 1 Jan_4 = 1 Jan_5 = 1 Jan_6 = 1 Jan_7 = 1 Jan_8 = 1 Jan_9 = 2 Jan_10 = 2 and so on until Jan_31 = 2 <tr> <td colspan="8">1</td> <td colspan="23">2</td> </tr> </table> I know it's really complicated but I hope I explained myself... What I have in mind is someway the columns need to be checked for a change in value at some point...select distinct( ) will make no sense because I want to compare the values in different fields not the same field....hope it makes sense... Thank You Dhaval |
|
#2
|
|||
|
|||
|
Let's make it simpler...
Hi everybody!
Well I know in my first post I made things complicated, now let's take it this way... For the month of January there are 31 days... so there are 2 rows in this table on the top row there are 31 columns showing 31 days...and in the row below this one we will have to generate....colspan based on the below information pulled from the database... 2222211111111111111999999992222 in the above case we will have to get a colspan as follows: <tr> <td colspan="5"> 2 </td> <td colspan="15"> 1 </td> <td colspan="8"> 9 </td> <td>colspan="4"> 2 </td> </tr> This is all I want to do....I know it is difficult...but still waiting for some genius! Thank You! Dhaval |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Compare columns in table..big problem! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|