Hi everyone, i have another problem with one of my basic scripts, im making an inbox for my website. I have'nt started the send function yet but i added a row into the database manually just to test it.
$result = mysql_query("select * from messages WHERE receiver = '$session->username' ORDER BY id DESC LIMIT 0, 10");
while($r=mysql_fetch_array($result))
{
$id=$r["id"];
$sender=$r["sender"];
$reciever=$r["reciever"];
$subject=$r["subject"];
$read=$r["read"];
$message=$r["message"];
$date=$r["date"];
I think you can probably make out the table from this quote, anyway when i start to echo the results i place them in a table. The problem is that i have made two different kind of classes both different colors e.g.
<tr><td class="oddmesage_subject"><a href="#"><? echo "$subject"; ?></a></td>
<td class="oddmesage_from"><a href="#"><? echo "$sender"; ?></a></td>
<td class="oddmesage_replied"><a href="#">Reply</a></td>
<td class="oddmesage_delete"><a href="#">Delete</a></td>
<td class="oddmesage_report"><a href="#">Report</a></td></tr>
<tr><td class="evenmesage_subject"><a href="#"><? echo "$subject"; ?></a></td>
<td class="evenmesage_from"><a href="#"><? echo "$sender"; ?></a></td>
<td class="evenmesage_replied"><a href="#">Reply</a></td>
<td class="evenmesage_delete"><a href="#">Delete</a></td>
<td class="evenmesage_report"><a href="#">Report</a></td></tr>
That just repeats the same message twice. How can i get it so the first row selected appears in the oddmessage class then the second appears in even and 3rd appears in odd again and so on for the 10 messages selected ?
Any help ?