I'm making it very complicated, just going to break it into main parts.
I have a form that changes the boolean of a variable when the form is stored, although it is called by the function, the function must change the variable.
class updates {var $ yesno = false; Function UpdateBull () {$ this- & gt; Yes = true; }} So when the form is deposited, it will call $ up-> updateBool () to change the calling on the right when I < Code> var_dump ($ up-> yeso) , then it says false , when it should be true if I do this: class update {var $ yesno = false; Function UpdateBull () {$ this- & gt; Yes = true; Var_dump ($ this-> yesno); // & lt; - outputs true}} How can I not get the variable to print true in a different script Edit: $ sql = "Config WHERE boolean = 'true'" Choose Boolean; $ Result = mysql_query ($ sql); If (mysql_num_rows ($ result)> 0) {$ up-> UpdateBool (); } Other {header ("location: index.php? De = none"); } This is a part of the code where it is called. I can confirm that the SQL statement contains more than 1 record.
To change the boolean correctly, click the $ up-> UpdateBul ()
You start switching to a new page, where $ up will be a new object that objects do not continue in all requests when you call a new page , And all the variables start with scratch, then PHP "loses its memory." To continue the values in all page requests, you have to like something.
Comments
Post a Comment