Athene Numphe (athene) wrote,
Athene Numphe

  • Mood:
  • Music:

Made of awesome

For the group database project that's due in a week, we already made all these PHP forms and started adding some data and then oops, we realize that we didn't actually make any Foreign Key (FK) to Primary Key (PK) links between any of our 22 tables.

So I did some quick internet research and found out that we had created MyISAM tables when we needed InnoDB tables to link FKs. Then I figured out how to change the tables and how to use the SQL box in PHPmyAdmin to make changes to multiple tables at once. After that I figured out how to use PHPmyAdmin GUI interface to create FK links (it was actually really really easy).

But the image_media table kept giving me a "mysql error 1452" error when I tried to link gameID to the game table, even though the link from characterID to the character table worked just fine. I finally figured out that since we had already been playing with PHP forms, a game with the PK 1 was accidentally deleted, but because we hadn't linked the tables, the record in image_media that said it came from game FK 1 was still there. I changed the record in image_media to the right FK and it worked fine. I even changed the PK in the games table and it automatically updated it in the image_media table.

Yes, I am awesome!
Tags: awesomeness, databases, grad school, program

  • Carnival in New Orleans

    We decided that 2.75 would be the perfect age for Little Prince to experience his first Mardi Gras in New Orleans. On Thursday, Feb 27, we got into…

  • Holidays and a trip to MA

    Although I was sick on Yule, we had our Yule celebration (somewhat muted) anyway. We got our Little Prince his very own R2D2, which made him very…

  • Yesterday was almost awful but then it wasn't.

    Yesterday started off with me waking up with pain in my right side. I'd slept with a regular body pillow, but it's just not working right for me.…

  • Post a new comment


    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded