I ahve just created a web forum using PHP & MySQL, it is only a basic forum and i am now trying to change to look of it etc.
I have been playing about with some code to try and alternate the colour of the posts as the appear on the screen, say the first will be a pale blue and the next will be a white, then pale blue then white and so on and so forth. I have told to database to create an ID value for each post, and have been trying to use this `ID` value to determine which post should be which colour, i.e. every odd value will be the colour white and every even value will be pale blue.
Unfortunately every attempt has failed. How do i make it recognise an any odd or even number and make it change the background colour of the table to the corresponding colour?
I have been playing about with some code to try and alternate the colour of the posts as the appear on the screen, say the first will be a pale blue and the next will be a white, then pale blue then white and so on and so forth. I have told to database to create an ID value for each post, and have been trying to use this `ID` value to determine which post should be which colour, i.e. every odd value will be the colour white and every even value will be pale blue.
Unfortunately every attempt has failed. How do i make it recognise an any odd or even number and make it change the background colour of the table to the corresponding colour?