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

  • Why hello cedar, I hate you

    I've been at work for a while now, but I'm having trouble concentrating on anything. Why is that? Because I'm so stuffed up, even with the Claritin…

  • Delightful meal

    This weekend my father and step-mother came into town. On Saturday night we left the little prince with a babysitter and went out to Uchiko for a…

  • Boris update and the weekend

    Every day Boris looks to be moving better and better. This is a good thing. We will still be keeping an eye on him to see how he is progressing.…

  • 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