Jump to content

Associating An Array's Value to a Database Field's Value


CloudSex13

Recommended Posts

I have a coding problem that has stumped me for the past week:

 

For example, let's say I have a field in a database called Container under the table Users containing the following values: 1,2,3,64,3,3,3,1

 

I'm trying to link those values to another table in the same database called Things where the user's Container is equal to the ThingID, and then echo all the ones that match.

 

Could anyone offer me a bit of help in how to go about this?

 

Thank you, if so.

Assuming it's mysql, this query (I made up UserID_Field, for lack of a real name) should get you close enough to figure it out.

 

SELECT *.`Container`,*.`Things` FROM `Container`,`Things` WHERE `ThingID`.`Things` = `UserID_Field`.`Container`

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.