SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,338
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Creating lookup table, in DB book

    ? about pp 98-99 of DB book (2004)

    This is about the jokecategory lookup table. On pages 98-99 we create the table for the lookup table. However, you don't say how the IDs are hooked up. I suspect that it's my job to match up every pair, coding it by hand. Is this correct? (I think it's obviously YES.) You went from creating the lookup table directly to the code to use it, glossing over the making of the pairs.

    Sorry for such a stupid question. (I'm looking for a magic bullet that cuts down on the workload.)

    Thanks again!
    Steve

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I don't have this book, but the answer should be that yes, you need to write code to insert rows into this table with the corresponding IDs. It'll be the job of whatever page you create that lets you choose categories for a joke.

  3. #3
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,338
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you, Dan!

  4. #4
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Yes, at that point in the book you would need to write separate INSERT queries to manually match up rows in the two tables by creating new entries in the lookup table.

    In the next chapter, you'll see how to write PHP scripts that do this kind of work for you.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


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
  •