Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialStu Parker
4,814 Pointspassing array through function
um...drawing a blank here.. have returned data through fetchall, using fetch_assoc, but brain melt on passing that array through 4 argument function...
1 Answer
Brian Jensen
Treehouse StaffCheck out this solution by Simon Coates here view solution
I have pasted their solution here with syntax highlighting for your convenience:
<?php
include "helper.php";
$rows = $results->fetchall();
foreach ($rows as $row) {
send_offer($row['member_id'], $row['email'], $row['fullname'], $row['level']);
}
Stu Parker
4,814 PointsStu Parker
4,814 Pointsthanks brian...I had tried this but with the fetch_assoc but clearly that was one step too far lol