Welcome Guest, Not a member yet? Register   Sign In
Query database and insert result in an existing array
#2

[eluser]CroNiX[/eluser]
Code:
foreach($results as $row) {

Try changing it to
Code:
foreach($results as &$row) {//pass by reference - use ampersand
that way when you
Code:
$row->status => 'true'; // or false
it will be overwriting the value in the ORIGINAL array ($results - which is what you are returning). Otherwise you're just changing the value of the $row variable which gets overwritten on each iteration and has nothing to do with $result.


Messages In This Thread
Query database and insert result in an existing array - by El Forum - 03-08-2013, 01:34 PM
Query database and insert result in an existing array - by El Forum - 03-08-2013, 02:16 PM
Query database and insert result in an existing array - by El Forum - 03-08-2013, 04:12 PM
Query database and insert result in an existing array - by El Forum - 03-10-2013, 10:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB