Jump to content

Using PHP associative arrays to replicate sql joins


phobucket

Recommended Posts

Hello,

 

I am very new to PHP, but do alot of SQL programming and have a question about using PHP to replicate some SQL functionality that is not available on a client installation because they use an older version of MySQL (4.0.x) which does not support subqueries/views and the logic/table structures prohibit a JOIN only solution.

 

Can I join multiple associative arrays based on a matching element in the array? 

 

Simplified example:

$arr_proj_description['PROJ123','Some Project','This project blah blah blah'];

$arr_proj_status['PROJ123','20100220','LATE'];

 

// desired output

$arr_proj_results['PROJ123','Some Project','This project blah blah blah','LATE','2010220']

 

In actuality, each array would have multiple rows, may have a different number of rows (multiple project status records), and may be in a different order.

 

Thanks

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.