First row not selecting? or last using DESC
Posted: Tue Jul 08, 2003 6:37 pm
I'm using the below code to select my rows.
For some very odd reason even when i send 5 messages to user name 'darkside' the first row doesnt echo out? its just not there.
I only noticed this because I wanted to replace the above $result for
and here it was that last once assed and not the first?
I've got alot of code here so I'm not sure wot code ppl need to help me fix this but i think it has to be something to do with when I select the rows? I even tried just
Any help wouldnt go a miss! thanks
darkside
Code: Select all
$result = mysql_query("SELECT ID, Name, Subject, Messto, Messages, date, Readmes FROM messages WHERE Messto = '" .$userїname]. "'");
$row = mysql_fetch_array($result);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {I only noticed this because I wanted to replace the above $result for
Code: Select all
$result = mysql_query("SELECT ID, Name, Subject, Messto, Messages, date, Readmes FROM messages WHERE Messto = '".$userїname]."' order by 'ID' DESC");I've got alot of code here so I'm not sure wot code ppl need to help me fix this but i think it has to be something to do with when I select the rows? I even tried just
Code: Select all
$result = mysql_query("SELECT ID, Name, Subject, Messto, Messages, date, Readmes FROM messages");darkside