niche Posted August 17, 2011 Share Posted August 17, 2011 I'm using information from 4 tables. This info is used to assign data to many variables where each assignment is a line of code. What techniques, approaches, concepts are available that can significantly reduce the time it would take to make these variable assignments other than simply reducing the amount of data I'm using through elimination or combining variables? Link to comment Share on other sites More sharing options...
ShadowMage Posted August 17, 2011 Share Posted August 17, 2011 Loops and arrays? Link to comment Share on other sites More sharing options...
niche Posted August 17, 2011 Author Share Posted August 17, 2011 Thought about that. In fact, woke-up this morning thinking I could aggregate the needed info in a single column and take it apart in a loop, but decided that was probably no different than a loop and mysql_fetch_array. Right? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 17, 2011 Share Posted August 17, 2011 If you access the data frequently and it doesn't change very option, one option would be to build a data structure like an object or array and store the serialized version in the database. You can read that string and unserialize it all at once back into a data structure. Whenever the data changes you'll need to create the new data structure and update the database with the serialized version. Link to comment Share on other sites More sharing options...
niche Posted August 17, 2011 Author Share Posted August 17, 2011 What do mean serialize? Link to comment Share on other sites More sharing options...
thescientist Posted August 17, 2011 Share Posted August 17, 2011 he means to turn them to and from strings.http://php.net/manual/en/function.serialize.php Link to comment Share on other sites More sharing options...
niche Posted August 18, 2011 Author Share Posted August 18, 2011 Looks promising. I'll check it out. Thanks to ShadowMage, justsomeguy, and thescientist. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.