Jump to content
Larry Ullman's Book Forums

nikifi

Members
  • Posts

    2
  • Joined

  • Last visited

nikifi's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hello there, thanks for the response. I doubt it was even referring to PHP. I don't have a reference, it's just one of those things I remember reading somewhere and it remained in my head. I don't even know if it is from a reputable source, but I figure I'd post the question here and see your point of view.
  2. 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?
×
×
  • Create New...