Hello there, first of all I want to say I am a big fan of Larry Ullman's book. I used it to learn introductory PHP and now I am back learning advanced PHP. I am in chapter one working through the task list example. I have come across the following code:
while (list($task_id, $parent_id, $task) = mysqli_fetch_array ($r, MYSQLI_NUM)) {
echo "<option value=\"$task_id\">$task</option>\n"; $tasks[] = array('task_id' => $task_id, 'parent_id' => $parent_id, 'task' => $task);
}
My question is - I thought I read somewhere that it is a bad practice to set a variable in a conditional statement, as in the case here where it is setting a list of variables to the values of an array. Is there any basis to this statement?