Jump to content

Matching array value to text


drummer101

Recommended Posts

So I've got two ways to go about this problem, and I'm not entirely sure which would be better.

 

I've got a database table, with all the ID's and text to match.

 

Array (

    [item1] => '2359',

    [item2] => '8392',

    [item3] => '8938',

    [item4] => '3127',

    [item5] => '3289'

)

 

id        name

2359  eggs

3127  milk

3289  cheese

8392  wine

8938  bread

 

How would I go about matching my table name values to the display of the array?

 

Well I guess since the items will go in a table separate of the master list of items, I could just join on the id and then pull the name from that?

 

Am I on the right track?

Link to comment
https://forums.phpfreaks.com/topic/146015-matching-array-value-to-text/
Share on other sites

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.