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 trialEdvin Zigmanovic
7,586 PointsPHP, passing database queries to functions
I'm getting told that "You need to pass all 4 arguments" and after half an hour of trying to fit it I give up.. When I do a "print_r($reult["member_id"])" in the foreach loop for ex. I can actually see the id's "123" being displayed in the "view code" window.
So, why are my 4 argument not passing through the "send_offer()" function/method?
<?php
include "helper.php";
foreach($results->fetchALL(PDO::FETCH_ASSOC) as $result) {
send_offer($result["member_id"], $result["email"], $result["fullname"], $result["level"]);
}
/*
* helper.php contains
* $results->query("SELECT member_id, email, fullname, level FROM members");
*/
1 Answer
Edvin Zigmanovic
7,586 PointsI restarted my chrome browser and then it worked upon re-submission! Thanks Simon!
Simon Coates
28,694 PointsSimon Coates
28,694 Pointsi just copied your code into that challenged. It passed. no alteration required.