Undefined variable error when using defined variable in PHP? -
I am creating a website, where I am logged in, press a button and then some information is filled with a database code One thing works well for something that is: I get this error:
& lt; B & gt; Notice & lt; / B & gt; Undefined Variable: Error & lt; B & gt; / Character-load php & lt; / P & gt; On the line & lt; B & gt; 42 & lt; / B & gt; & Lt; Br / & gt;
But the variable is defined here:
if ($ user ["restricted"] == 1) {$ error = 1; } If (mysql_num_rows ($ letters) == 0) {$ error = 1; } If (mysql_num_rows ($ user name) == 0) {$ error = 1; } If (empty ($ charid)) {$ error = 1; }
Is there something wrong with that? I do not understand why it says that the variable error is undefined? I can add more information about the request because I do not really know what else to add.
Try it -
$ error = 0; If ($ user ["restricted"] == 1) {$ error = 1; } If (mysql_num_rows ($ letters) == 0) {$ error = 1; } If (mysql_num_rows ($ user name) == 0) {$ error = 1; } If (empty ($ charid)) {$ error = 1; }
and check the time of use.
Comments
Post a Comment