NoUser2U Posted June 11, 2011 Share Posted June 11, 2011 Thank you so much Deirde! It worked and now i can continue with what i was working on! :)I kind of feel embarrassed since it was actually too easy hehe. Thnx again! Link to comment Share on other sites More sharing options...
jeffman Posted June 11, 2011 Share Posted June 11, 2011 array_fill is NOT the correct function. Incrementally assigning values to an array is actually quite easy. A statement like this automatically adds a value to the next available index:$arr[] = $val;Put that in a loop and $arr will fill up will the changing values of $val. Do you want to return the whole row or just the value of $row['fieldname'] ? Either way, the plan is the same: while($row = mysql_fetch_assoc($result)) { $arr[] = $row['fieldname']; }return($arr);// ORwhile($row = mysql_fetch_assoc($result)) { $arr[] = $row; }return($arr); Link to comment Share on other sites More sharing options...
NoUser2U Posted June 11, 2011 Author Share Posted June 11, 2011 Thank you so much Deirde! It worked and now i can continue with what i was working on! :)I kind of feel embarrassed since it was actually too easy hehe. Thnx again! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.