"delete" working erratically on ODBC

From: Date: Fri, 12 Jan 2001 15:38:52 +0000
Subject: "delete" working erratically on ODBC
Groups: php.db 
Request: Send a blank email to php-db+get-5828@lists.php.net to get a copy of this message
Hi All! I've a encountered a baffling problem in one project of mine. It's a data entry application build to work as a "stand-alone" app - it's all on a PC, built on Win98, PWS, PHP 4.0.3, and access 2000 as DB, accessed (pun not intended!) thru ODBC. I wished to delete all rows from a couple of tables, to start filling them anew. So I issued the following commands: [...] if (!isset($conn)) { $statusOpen=DB_Open(&$conn,$dbName); } if(!$statusOpen) die ("error in DB ".$dbName); $ji=odbc_exec($conn,"DELETE FROM table1"); echo "->$ji<-<br>"; $ji=odbc_exec($conn,"DELETE FROM table2"); echo "->$ji<-<br>"; [...] The two "echo"s are for debug purposes, obviously. Actually, no error condition is returned. On screen I see that both echo print a valid result ID. But the second DELETE is NOT executed! All rows all still there, after the execution. If I change the order of the query, i.e. [...] $ji=odbc_exec($conn,"DELETE FROM table2"); echo "->$ji<-<br>"; $ji=odbc_exec($conn,"DELETE FROM table1"); echo "->$ji<-<br>"; [...] Data in table2 are deleted, and data in table1 are still there! Even If I put some other query in the middle, it appears that only the first "DELETE" is really executed, while the other is silently ignored. Somebody has a clue on what's happening??? TIA, bye! /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Fabrizio Ermini Alternate E-mail: C.so Umberto, 7 faermini@tin.it loc. Meleto Valdarno Mail on GSM: (keep it short!) 52020 Cavriglia (AR) faermini@sms.tin.it

« previous php.db (#5828) next »