note 104469 deleted from language.variables.scope by danbrown

From: Date: Thu, 16 Jun 2011 17:03:43 +0000
Subject: note 104469 deleted from language.variables.scope by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-180625@lists.php.net to get a copy of this message
Note Submitter: khanquered at gmail dot com ---- Here is one example, how the 2nd function(thank_mssg) can access the variable $operation from the first function(add_word). keep in mind, that the variable has to be declare global in both function. function add_word($_POST) { global $operation; $eword = get_post('eword'); /// if words are presents than run this query $d3000_query="do something with the DB"; $operation = mysql_query($d3000_query); } function thank_mssg(){ global $operation; if($operation) return ("thank you for adding a word"); else { return die(" Not working ) : ".mysql_error()); } }

« previous php.notes (#180625) next »