ODBC looping on Linux

From: Date: Thu, 23 May 2002 13:06:46 +0000
Subject: ODBC looping on Linux
Groups: php.general 
Request: Send a blank email to php-general+get-98904@lists.php.net to get a copy of this message
hello I have some queries in a script on the following environment: Linux Debian Apache 1.3.19 Patched Ben Php 4.0.6 patched UnixODBC driver manager latest version (installed yesterday) freeTDS driver DMBS -> MicrosoftSQL 7. I have a few queries: line 15 -> connection string line 20: qry nr. 1 -> SELECT line 25 qry nr. 2 -> SELECT line 30 qry nr. 3 -> UPDATE The SELECTs do work. The UPDATE doesn't, THE BROWSER (Mozilla) goes into a looping cicle (re-calling the same page with no end) If I move the UPDATE qry UPDATE up to line 16 immediately after the connection, then it works correctly. Data are updated So, why??? The code sample is as follows -> connection string is here <--- $SQL_R_AVAILABLE = "SELECT top 1 etc etc"; $res_r_avail = @odbc_exec( $conn, $SQL_R_AVAILABLE ); if ( $res_r_avail ) { odbc_fetch_row($res_r_avail); $sendavailable = @odbc_result($res_r_avail, "sendavailable"); $ttoday = @odbc_result($res_r_avail, "ttoday"); odbc_free_result($res_r_avail); if ( $ttoday == "" ) { $sql = "UPDATE tableT SET ttoday=getdate() where condition"; $resUpd = @odbc_exec( $conn, $sql ); ^^^^^ THIS QUERY MAKES THE SCRIPT (BROWSER) GO IN A LOOP } } ////////////////////////////////////// I maybe suspect it's because the result is occupied by the select above but ... don't know what to put before UPDATE to free the resources. odbc_free_result doesn't seem to work.. Thank you all Nicola Delbono /////////////////////////////////////////// Il notiziario dei notiziari http://www.notiziarioweb.it/ /////////////////////////////////////////// www.smscitta.com | www.musicalbox.it www.filosofo.it | www.bollicine.com

« previous php.general (#98904) next »