temporary error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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? 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux