Results 1 to 2 of 2

Thread: PHP mysql_query string problem...

  1. #1
    Join Date
    Feb 2011
    Posts
    3

    Wink PHP mysql_query string problem...

    I have a simple query that I want to use to query the MySQL database and come up with my 5 of my upcoming events that are listed.

    I am currently using SELECT * FROM `events` ORDER BY `start_date`, `time` ASC LIMIT 5

    For some reason when I take out the LIMIT 5 it works but with the LIMIT 5 it shows nothing.

    Any help is appreciated.

  2. #2
    Join Date
    Mar 2011
    Posts
    38
    Hello Friend,
    In this query you used "LIMIT" and you have given only 5 alone, so it is not displaying any values. The correct syntax for LIMIT is

    LIMIT X , Y ----> Here we have to specify X which is the starting index and Y is the count. For example LIMIT 5, 5 this will display the record from 6th Index to the 10th Index.

    Hope this will solve your problem.


    Ahamed

Similar Threads

  1. executing php code in a string
    By Littlened in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 13 Jul 2006, 10:48 AM
  2. PHP : Parsing Contents of a String
    By Logan in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 29 Nov 2005, 02:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •