ball420 Posted June 19, 2007 Share Posted June 19, 2007 i want my newest entries to be listed first on the page that reflects the database how would i go about this???? Quote Link to comment https://forums.phpfreaks.com/topic/56218-pulling-form-sql/ Share on other sites More sharing options...
jvrothjr Posted June 19, 2007 Share Posted June 19, 2007 Asc or Desc if you have a auto_increment field you can use this field to sort. by default it with read in order of ASC. Quote Link to comment https://forums.phpfreaks.com/topic/56218-pulling-form-sql/#findComment-277675 Share on other sites More sharing options...
aniesh82 Posted June 19, 2007 Share Posted June 19, 2007 If the records you need to show has a date field or primary key columns, then use the select query select * from tableName order by datefield ASC limit 0, 1 or select * from tableName order by primaryKeyName ASC limit 0, 1 Quote Link to comment https://forums.phpfreaks.com/topic/56218-pulling-form-sql/#findComment-277676 Share on other sites More sharing options...
ball420 Posted June 19, 2007 Author Share Posted June 19, 2007 thanks i'll give it a try any thoughts on the bad word filter Quote Link to comment https://forums.phpfreaks.com/topic/56218-pulling-form-sql/#findComment-277679 Share on other sites More sharing options...
ball420 Posted June 19, 2007 Author Share Posted June 19, 2007 Asc or Desc if you have a auto_increment field you can use this field to sort. by default it with read in order of ASC. what would my code look like for this?? Quote Link to comment https://forums.phpfreaks.com/topic/56218-pulling-form-sql/#findComment-277687 Share on other sites More sharing options...
jvrothjr Posted June 19, 2007 Share Posted June 19, 2007 $QSdist = "SELECT * FROM Tblname Order By Field_Name Desc";[\code] Quote Link to comment https://forums.phpfreaks.com/topic/56218-pulling-form-sql/#findComment-277704 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.