Invalid Argument
I am getting the error message "Invalid argument supplied for foreach()". I can't see to figure out what. Below is my query. Is there something I'm missing? Thanks
public function editRole($id) {
$q = $this->_db->query("SELECT * FROM `" . TP . "roles` WHERE `ID` = '" . floatval($id) . "' LIMIT 1");
while($r = $q->fetch_array()) {
$id = $r[0];
}
return $id;
}
35 Minutes
Discussion Span
Related Article: Email Contact Form Argument Error
is a PHP discussion thread by rollerhockey97 that has 11 replies, was last updated 6 months ago and has been tagged with the keywords: contact, form, argument, error, php, email.
joshmac
Junior Poster in Training
84 posts since Apr 2008
Reputation Points: 16
Solved Threads: 5
Skill Endorsements: 0
Are you sure you are showing the right snippet? If it is the while then the query must have failed. Add some debugging.
pritaeas
Posting Prodigy
9,316 posts since Jul 2006
Reputation Points: 1,178
Solved Threads: 1,467
Skill Endorsements: 86
Question Answered as of 5 Months Ago by
pritaeas