Ok, so I’m not used to using the foreach loop, so tell me if this is (in theory) getting too complicated to work…
First, I have a function that gets all of the info I need from my database, it returns an array sort of like this:
[code=php]
$myrow[0][‘id’] = ‘165’;
$myrow[0][‘name’] = ‘Sally’;
$myrow[0][‘age’] = ’23’;
$myrow[0][‘status’] = ‘Employed’;
Ok, so then I use this to try and process the data: … sort of.
[code=php] foreach(pullData(‘SELECT from myDB WHERE name = Sally’) as $value){
list(‘id’,’name’,’age’,’status’) = $value;
// Do whatever you were going to do with the data… code goes here.
}
My intent is to grab each row as I go in the easiest way possible (without having to re-type the “get data from the database” stuff each time I need to use it, just a quick “pullData($query)” function to grab everything… and then use it one line at a time [I]after