1289solutions

<web> Your Code has 1289solutions </web>

Wednesday, 11 November 2015

php get the last row with MySQL

If you want the last 10 then just change ASC to DESC

SELECT * 
FROM 
chat 
WHERE 
(userID=$session AND toID=$friendID) 
OR 
(userID=$friendID AND toID=$session) 
ORDER BY id 
DESC
LIMIT 10
SELECT * FROM chat WHERE (userID=$session AND toID=$friendID) OR (userID=$friendID AND toID=$session) ORDER BY id DESC LIMIT 10
Posted by Abhishek at Wednesday, November 11, 2015 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

know new tip

Abhishek
View my complete profile

Blog Archive

  • ►  2019 (2)
    • ►  April (1)
    • ►  February (1)
  • ►  2018 (9)
    • ►  October (5)
    • ►  August (4)
  • ►  2017 (1)
    • ►  January (1)
  • ►  2016 (3)
    • ►  June (2)
    • ►  February (1)
  • ▼  2015 (9)
    • ▼  November (1)
      • php get the last row with MySQL
    • ►  September (1)
    • ►  August (2)
    • ►  June (2)
    • ►  April (2)
    • ►  February (1)
  • ►  2014 (3)
    • ►  October (1)
    • ►  September (1)
    • ►  July (1)
  • ►  2013 (27)
    • ►  November (1)
    • ►  September (6)
    • ►  June (3)
    • ►  May (3)
    • ►  April (1)
    • ►  February (2)
    • ►  January (11)
  • ►  2012 (45)
    • ►  December (22)
    • ►  November (23)
1289solution. Picture Window theme. Powered by Blogger.