Jump to content

Assign value and give error


son

Recommended Posts

I have a script and cannot get my head around the following:

if (mysqli_num_rows($result) == 0)  {    $number = 1;    echo "\n<!-- number does not exist -->\n";	}

In the database we have an entry for the variable $number = 1 as such. It is a default that shows when no other existing option is selected. Why would we assign 1 to $number and then give error message? If we assign an existing value, then surely the message will never come up. The script is working just fine, I just try to understand (has been developed by someone who knows more than I do)... I hope I make senseSon

Link to comment
Share on other sites

Well, the error is commented out (in the HTML) - maybe the coder just wanted to use that statement to debug...

Link to comment
Share on other sites

Well, the error is commented out (in the HTML) - maybe the coder just wanted to use that statement to debug...
That makes sense. Maybe he just had it in to start off with and then commented it out later on adding the assignment line...Thanks,Son
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...