Jump to content

Cross Referencing Tables


Recommended Posts

I am fairly new to MySQL so I am still learning things.


I have two tables one is a numbered checklist(1990ToppsTraded) and the other is a table(ttmautos) filled with different types of information. Depending on what is put in a certain field(collection) of ttmautos. If the collection field says "1990 Topps Traded" it will place a 1 in the signed field of 1990ToppsTraded.


Is there a way for me to do this in the database or do I have to do it through a SQL Query in my page? How would I do it either way.


Any Help would be appreciated in this manner

Link to comment
Share on other sites

Ok I will try and clarify it up some.


I have two databases 90toppstraded and ttmautos. In the 90toppstraded database their is a field called signed that gets a variable of either 1 or 0. In the ttmautos database their is a field called project that has different data in it based on the project.


What I am want to do is fill the signed field of 90toppstraded with a one every time that the project field of the ttmautos database says "1990 Topps Traded". I am hoping to do this with out having to enter it manually every time.

Link to comment
Share on other sites

I understand the join function to a point. However I want all of the information to be displayed from the 90toppstraded database. It is a checklist of sorts. I want it to show what signatures I have and what signatures I still need to complete the list. Is there a way that I can do that?


I am pretty new to MySQL and I understand the basics of it. So excuse me for my ignorance on this matter

Link to comment
Share on other sites

Do a LEFT JOIN onto the table where the person has the signatures ... For example (no fields were given, so I am making the fields up):


FROM ttmautos a
LEFT JOIN 90toppstraded b ON a.AutoID = b.AutoID


This will retrieve every row in the ttmautos table and either NULL if there is no matching row in the 90toppstraded table OR the row from that table where there is the match.


Hope this helps.



Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.