SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast MeGa's Avatar
    Join Date
    Jul 2003
    Location
    Miami, FL
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    good practice over MySQL?

    a have a PHP script that takes rows from a MySQL DB, currently i have 98 rows (members on a site) but it's dramatically growing.

    Is it a good idea to use in a query LIMIT -1 , 0 to output all rows?
    I am asking it based on both, mysql & php performace and the conditions on my site..

    thanks again ppl!
    MeGa
    Be the Best, but don't Believe it.

  2. #2
    Mal Reynolds Mandibal's Avatar
    Join Date
    Aug 2003
    Location
    Columbus
    Posts
    718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why would you use "LIMIT -1, 0" to output all rows instead of just "select * from table_name"?
    Erh

  3. #3
    SitePoint Addict Resident Evil's Avatar
    Join Date
    May 2003
    Location
    Barrow
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah, dont be daft :-)

    selecy *

    is clearleh the way to go, just dont limit it

  4. #4
    SitePoint Enthusiast MeGa's Avatar
    Join Date
    Jul 2003
    Location
    Miami, FL
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cuz of some lazy interactive work

    what returning to my ogirinal post, would it be a good idea?
    MeGa
    Be the Best, but don't Believe it.

  5. #5
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ..Then again you shouldn't use select * either. you should only select the fields you need. For example, if it's a member list, you can eliminate password, and any other fields that you don't show on the memberlist (perhaps MSN, AIM, YIM contacts etc.). This will speed up query times.

    Regards.
    someonewhois

  6. #6
    SitePoint Addict Resident Evil's Avatar
    Join Date
    May 2003
    Location
    Barrow
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just do the query but dont set a limit /.....

  7. #7
    SitePoint Enthusiast MeGa's Avatar
    Join Date
    Jul 2003
    Location
    Miami, FL
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know, i never say i do a SELECT * query. i only select the ones i did. but in all queries i have a LIMIT $LIMIT , $START (just ex.)

    Because my site gives options to what to display with textboxes (user input numbers) rather than clicking on links (like next page), i was wondering if -1 would be a good idea to display all rows from one time.

    now, i can edit my php to make to do not add LIMIT if some special text (or number) is entered. but i was just wondering, would it still be a good idea to use -1 , 0 ?

    thanks
    MeGa
    Be the Best, but don't Believe it.

  8. #8
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So you NEED to supply a limit, because of the way you have your own query function structured?

  9. #9
    Non-Member
    Join Date
    Nov 2003
    Location
    here
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats what hes saying mate.

  10. #10
    SitePoint Enthusiast MeGa's Avatar
    Join Date
    Jul 2003
    Location
    Miami, FL
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    YES! i do need to supply querries numbers.
    MeGa
    Be the Best, but don't Believe it.


Bookmarks

Posting Permissions

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