MySQL Forums
Forum List  »  PHP

Re: Seeks Improved Efficency: Redundant Query Data
Posted by: stanley tweedle
Date: April 29, 2013 12:12PM

Examinging my table more closely, reflecting upon Normalization, trying to remember how to do this, etc., i see i'm working with-- essentially-- 3 bits of data.
1: the Date
2: The Cartoon Title (vs. Various Episodes, a one-to many REL)
3: the toontime (Eg. at what point in time, on the DVR timeline, between 00:00:00 and 00:59:99)

It's clear, here, considering the one-to-many relationship revealed, I could improve this table layout.

This revelation, however, I'm afriad, does not quite solve my problem. What I seem to be having difficulty with (hence my placement into the PHP zone, vs general SQL issues): when dealing w/ a /NEW/ entry (Eg. such that an INSERT must be made in the Master table), moving on to a new details entry...

What is a recommended approach
for handling the existing Master Data keys / indexes (Eg. the PK & Date-as-Index from Master/ Table1), VS dealing w/ details, as will relate to that data?

In other words, assume i
INSERT Master #33 .2010-01-01 (where #octothorpe -eq PK and 'dot'.IndexDate)
how should i approach the PHP for the next step? I'll have mysql_insert_id() available to me, and whatever other functions i can't remember presently, so that will give me my PK.

I can use that PK to administer SELECT statments on the subsequent INSERT.Details query. Okay, it's coming back to me, but i'm still not there.

Remember, way-back up in the original text, where I /asked/ something about "I Don't need that PK and the Index" in every INSERT statement, do I?"

This, I see is a dynamic problem, relevant to PHP and SQL. Sure, I can further reduce redundant data, but this isn't a high-volume public application; not at all subject to tax the CPU / system; i've already entered 50+ rows of data (Eg. half-the data entry, nearly).

Right now, i just want to create my PHP / HTML interface and be done with it. If that reads as a cop-out, so be it. It is. ha-haw!

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.