Dethman Posted August 14, 2008 Share Posted August 14, 2008 Ok I need to make this work I get the error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC LIMIT 4' at line 1 this is the Query I am using: $QUERY = "SELECT * FROM `Gallery` ASC LIMIT 4"; Any help would be awesome! Thank You, Brian Flores CEO, NimbusGames,llc Link to comment https://forums.phpfreaks.com/topic/119722-solved-limit-sql-query-how-would-i-do-this/ Share on other sites More sharing options...
revraz Posted August 14, 2008 Share Posted August 14, 2008 Need to use ORDER BY with ASC Link to comment https://forums.phpfreaks.com/topic/119722-solved-limit-sql-query-how-would-i-do-this/#findComment-616805 Share on other sites More sharing options...
Dethman Posted August 14, 2008 Author Share Posted August 14, 2008 Sorry not sure what SORT BY is? Want to tell me how to use it? Link to comment https://forums.phpfreaks.com/topic/119722-solved-limit-sql-query-how-would-i-do-this/#findComment-616807 Share on other sites More sharing options...
genericnumber1 Posted August 14, 2008 Share Posted August 14, 2008 you probably mean $QUERY = "SELECT * FROM `Gallery` ORDER BY id ASC LIMIT 4"; change id to your primary, auto_increment key... if you don't have one you'll need to do it differently. Link to comment https://forums.phpfreaks.com/topic/119722-solved-limit-sql-query-how-would-i-do-this/#findComment-616809 Share on other sites More sharing options...
Dethman Posted August 14, 2008 Author Share Posted August 14, 2008 nah its ok its called id Um that query var should work now Ill test it and get back with you, also add me to msn and yahoo [email protected] [email protected] Thanx Link to comment https://forums.phpfreaks.com/topic/119722-solved-limit-sql-query-how-would-i-do-this/#findComment-616813 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.