Monshery Posted October 21, 2006 Share Posted October 21, 2006 some kinda of post replay form .it has a continuance in my page :-)[code] $INSERTD = mysql_query("INSERT INTO xxxxxx (id, name, email, massage, show_mail) VALUES ('$f','$_POST[name]', '$_POST[email]', '$_POST[massage]', '$_POST[show_email]')",$post_LINK); $post_LINK=mysql_connect('xxxxx','xxxxxx','xxxxxx') or die("Connection fail"); mysql_select_db('xxxxxx',$post_LINK); $MASSAGES_links = mysql_query("SELECT * FROM xxxxxx",$post_LINK);/* basicaly here i start showing the table */ while($MASSEGES=mysql_fetch_array($MASSAGES_links)) { ?> <table width="427" height="54" border="0"> <tr> <td width="26" height="23"><?php echo $MASSEGES['id'];?></td> <td width="117"><span class="style2"><strong>Name:</strong> <?php echo $MASSEGES['name'];?></span></td> <td width="250"><span class="style2"> <?php if ($MASSEGES['show_mail'] == "show_email") { echo "<strong>Email: </strong> ". $MASSEGES['email']; }?> </span></td> </tr> <tr> <td height="23" colspan="3"><p><span class="style2"><strong>Massage: </strong><?php echo $MASSEGES['massage'];?></span> </p> <p>-----------------------------------------------------------------</p></td> </tr> </table> <?php } ?>[/code]what i am trying to do and dont know how iti want it to show the resualt in backward order instead it will show newest raw as last i want it to show the newest as first in page and go on down the table to the oldesThis suppost to be some kinda of post replay form . you have a window to post a replay after you do its just add it to database and then show it in table with fatch array. but its showing me the oldest replay as first in page instead of doing it like a forum which the first replay show's first in the page ..if anyone will help i will realy much appricate it thanks in advanced. Quote Link to comment https://forums.phpfreaks.com/topic/24694-trying-to-use-mysql_fetch_array-but-diffrant-way-help/ Share on other sites More sharing options...
kamasheto Posted October 21, 2006 Share Posted October 21, 2006 just add DESC id at the end of your SQL query, should fix that for you Quote Link to comment https://forums.phpfreaks.com/topic/24694-trying-to-use-mysql_fetch_array-but-diffrant-way-help/#findComment-112474 Share on other sites More sharing options...
Monshery Posted October 21, 2006 Author Share Posted October 21, 2006 [quote author=kamasheto link=topic=112280.msg455610#msg455610 date=1161466694]just add DESC id at the end of your SQL query, should fix that for you[/quote]What mean DESC ID ? Quote Link to comment https://forums.phpfreaks.com/topic/24694-trying-to-use-mysql_fetch_array-but-diffrant-way-help/#findComment-112488 Share on other sites More sharing options...
hostfreak Posted October 21, 2006 Share Posted October 21, 2006 http://www.phpfreaks.com/mysqlref/16.php[code] $MASSAGES_links = mysql_query("SELECT * FROM xxxxxx ORDER BY id DESC",$post_LINK);[/code] Quote Link to comment https://forums.phpfreaks.com/topic/24694-trying-to-use-mysql_fetch_array-but-diffrant-way-help/#findComment-112495 Share on other sites More sharing options...
Monshery Posted October 22, 2006 Author Share Posted October 22, 2006 ok thanks just figure out how its working Quote Link to comment https://forums.phpfreaks.com/topic/24694-trying-to-use-mysql_fetch_array-but-diffrant-way-help/#findComment-112528 Share on other sites More sharing options...
heckenschutze Posted October 22, 2006 Share Posted October 22, 2006 PPL, FORMAT YOUR QUERIES.[code]$MASSAGES_links = mysql_query("SELECT * FROM `xxxxxx` ORDER BY `id` DESC", $post_LINK);[/code] Quote Link to comment https://forums.phpfreaks.com/topic/24694-trying-to-use-mysql_fetch_array-but-diffrant-way-help/#findComment-112546 Share on other sites More sharing options...
.josh Posted October 22, 2006 Share Posted October 22, 2006 backticks are not necessary unless you are using mysql reserved words..and you shouldn't be using reserved words as table/field names in the first place. Quote Link to comment https://forums.phpfreaks.com/topic/24694-trying-to-use-mysql_fetch_array-but-diffrant-way-help/#findComment-112571 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.