Urgent!! How Can I Display records like this??


#1

How can i display two different records in one row?

Example:

|data 1 | data2 |

|data 3 | data4 |

        :

#2

Not exactly sure what you are have trouble with? The formatting of it or the way to go about it. Please give us more information and will be better able to help you.


#3

I want to display records by a table. A table with two columns.
In general, records are shown vertically.
How can I show records horizontally?

Example:

|data 1 | data2 |

|data 3 | data4 |

      :

example : http://www10.brinkster.com/babytear/question.htm

THx VERY MUCH


#4

logic:

query the database
get the number of results
start a row
loop to show results (for loop)
    display record
    if the for loop is even (look at mod)
        end the table row
        start a row
    end if
end loop

Make sense?


#5

That’s a nice answer lig ;)


#6

but lig, how does one check if a number is even? :D

I remember back when I used to play around with c++ that I would divide the number by 2 and check for a remainder, but I can’t remember now how I did that…


#7

It’s the modulus function
http://us2.php.net/operators.arithmetic

[php]
if (($Value % 2) == 0) {
//Value is even
} else {
//Value is odd
}
[/php]


#8

cool 8)