temporary error

From: Date: Thu, 21 Feb 2008 13:54:04 +0000
Subject: temporary error
Groups: php.general 
Request: Send a blank email to php-general+get-269784@lists.php.net to get a copy of this message
Consider the following code: $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ... etc etc ...." $queryInserimentoDatiAllenamentoCalciPiazzati = mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati); if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something } if($queryInserimentoDatiAllenamentoCalciPiazzati) { $logQueryInserimentoDatiAllenamentoCalciPiazzati = mysql_query("insert into log ... etc etc ..."); if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something } } if($queryInserimentoDatiAllenamentoCalciPiazzati && $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something } 1st execution: $queryInserimentoDatiAllenamentoCalciPiazzati && $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of last conditional statement, evaluates to false even if both queries are correctly executed. I modify as follows: $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ... etc etc ...." $queryInserimentoDatiAllenamentoCalciPiazzati = mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati); if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something } else echo("error message 1"); if($queryInserimentoDatiAllenamentoCalciPiazzati) { $logQueryInserimentoDatiAllenamentoCalciPiazzati = mysql_query("insert into log ... etc etc ..."); if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something } else echo("error message 2"); } if($queryInserimentoDatiAllenamentoCalciPiazzati && $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something } 2nd execution: $queryInserimentoDatiAllenamentoCalciPiazzati && $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of last conditional statement, evaluates to true. Now, I modify again, back to the original version: $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = "INSERT INTO ... etc etc ...." $queryInserimentoDatiAllenamentoCalciPiazzati = mysql_query($sqlQueryInserimentoDatiAllenamentoCalciPiazzati); if($queryInserimentoDatiAllenamentoCalciPiazzati) { // do something } if($queryInserimentoDatiAllenamentoCalciPiazzati) { $logQueryInserimentoDatiAllenamentoCalciPiazzati = mysql_query("insert into log ... etc etc ..."); if($logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something } } if($queryInserimentoDatiAllenamentoCalciPiazzati && $logQueryInserimentoDatiAllenamentoCalciPiazzati) { // do something } 3rd execution: $queryInserimentoDatiAllenamentoCalciPiazzati && $logQueryInserimentoDatiAllenamentoCalciPiazzati, where clause of last conditional statement, evaluates to true. Do you know any reason for that?

« previous php.general (#269784) next »