[Techtalk] PHP me-ha-what?

Emma Jane Hogbin emmajane at xtrinsic.com
Mon Feb 17 15:19:39 EST 2003


This is the strangest thing...the following function /works/ but it also
gives a warning. I'm not sure how to get rid of the warning as the
function itself actually works. Ideas?

        foreach ($to_delete as $del) { // LINE 289
                $sql_answer = "delete from answer where id = $del";
                $delete = mysql_query($sql_answer) or die("Could not clean out this answer.<br />$sql_answer<br />".
mysql_error());
        
                $sql_option = "delete from options where answers = $del";
                $delete = mysql_query($sql_option) 
                        or die("Could not clean out this option.<br />$sql_option<br />".mysql_error());
        }
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/emmajane/websites/langweb/generic/php/QuizQuestion.php</b> on line <b>289</b><br />
(but the delete WORKS!!)


AND
        if (in_array($this->qanswer, $to_delete)) { // LINE 284
                $this->messages = "You cannot delete the Right Answer for a question.";
        }

<br />
<b>Warning</b>:  Wrong datatype for second argument in call to in_array in <b>/home/emmajane/websites/langweb/generic/php/QuizQuestion.php</b> on line <b>284</b><br />

AGAIN, this /works/ but it gives the warning as well...

-- 
Emma Jane Hogbin
[[ 416 417 2868 ][ www.xtrinsic.com ]]



More information about the Techtalk mailing list