SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Jul 2002
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question SQL questions RE: Yank's book

    Two things:

    FIRST QUESTION - In Chapter 9 of Kevin's SQL book, page 125, he uses the following two examples to illustrate the LIMIT function:

    $sql = "SELECT * FROM Jokes ORDER BY TimesViewed DESC LIMIT 10";

    and

    $sql = "SELECT * FROM Jokes ORDER BY TimesViewed DESC LIMIT 20, 5";


    The first string returns the 10 most-viewed jokes.

    The second string, Kevin says, returns the 21st thru the 25th most-viewed jokes. I'm trying to figure out why, based on the first example, why the second example doesn't return the 20 most-viewed jokes; I'm assuming it's because the use of two comma-separated numbers means "start at 20 and show 5," which is a relatively different behavior than what the LIMIT function does in the first example. Just want to make sure I'm understanding it correctly.

    SECOND QUESTION: Chapter 8 of Kevin's book deals with MySQL administration using typed commands; my hosting company has MySQL and PHP installed. Thus, I don't have a need for much of the material covered here. Is this standard w/ most hosting companies? I'd prefer to skip over this info if I'm not likely going to need it in the construction and maintenance of most DB-driven sites.

    Thanks in advance.

    -JZ
    Last edited by jonzal; Aug 1, 2002 at 19:23.

  2. #2
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Question one: Yes, you've got it.

    Question two: The MySQL commands are typically used in the maintenance of MySQL on the web site, which is generally managed via an SSH (telnet-like) client. It is, more or less, a direct interface with your server from which you type commands and change account properties, and can interact with MySQL. Chances are your hosting company allows this; I would check with them. Then you'll know whether or not to read through the said section in the book.

    -Colin
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.


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
  •