blade_922 Posted September 15, 2006 Share Posted September 15, 2006 K here is my query[code]$hotmain=mysql_query("select * from mos_content ORDER BY `id` DESC LIMIT 2") or die(mysql_error());while ($donnee = mysql_fetch_array($hotmain)){ $title= $donnee['title']; $introtext=$donnee['introtext'];$author=$donnee['created_by']; }[/code]For some reason if i just want to display 2 items like i have done i typed 2 and it doesnt display anything, if i change the limit to 9 then it displays 2.Is there somethin wrong Quote Link to comment Share on other sites More sharing options...
blade_922 Posted September 15, 2006 Author Share Posted September 15, 2006 Disregard this post. I had set the Order by wrong. it should have been ordered by another field. Quote Link to comment Share on other sites More sharing options...
craygo Posted September 15, 2006 Share Posted September 15, 2006 query looks fine do you get any error????Only thing I can see it that you are not echoing anything out onto the screen[code]<?php$hotmain=mysql_query("select * from mos_content ORDER BY `id` DESC LIMIT 2") or die(mysql_error());while ($donnee = mysql_fetch_array($hotmain)){ $title= $donnee['title']; $introtext=$donnee['introtext'];$author=$donnee['created_by']; echo "$title: $introtext $author<br>";}?>[/code]Ray Quote Link to comment 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.