$recordset->Close() fails every time 
Author Message
 $recordset->Close() fails every time

Hi,

I'm just starting out with PHP after having used ASP for ages, and I'm using
the ADODB functions for recordset handling. I'm running W2KPro SP3, with
Apache 2, MySQL 4.04, and PHP 4.

My problem is with this type of code:
<?
$sql_string = "SELECT * FROM table;";
$rs_table = $db->Execute($sql_string);
$rs_table->MoveFirst();
$datafield = $rs_table->Fields("DataField");
$rs_table->Close() or die("Can't close Recordset for Last Updated Date!");
?>

I have used PConnect and Connect for the database variable, but everytime I
run the code, I get the error from the 'die' command on the Close()
function.

Am I missing some kind of setting in Apache or PHP configuration? My
error_reporting (in php.ini) is set to: E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR

Thanks in advance,

--
Ahd



Mon, 01 Aug 2005 21:45:21 GMT  
 $recordset->Close() fails every time
you can't close because it was not opened

try this

<?
$sql_string = "SELECT * FROM table;";
$rs_table = $db->Execute($sql_string);
$rs_table->MoveFirst();
$datafield = $rs_table->Fields("DataField")->value;
$db=null;
?>

Quote:

>Hi,

>I'm just starting out with PHP after having used ASP for ages, and I'm
using
>the ADODB functions for recordset handling. I'm running W2KPro SP3, with
>Apache 2, MySQL 4.04, and PHP 4.

>My problem is with this type of code:
><?
>$sql_string = "SELECT * FROM table;";
>$rs_table = $db->Execute($sql_string);
>$rs_table->MoveFirst();
>$datafield = $rs_table->Fields("DataField");
>$rs_table->Close() or die("Can't close Recordset for Last Updated Date!");
>?>

>I have used PConnect and Connect for the database variable, but everytime I
>run the code, I get the error from the 'die' command on the Close()
>function.

>Am I missing some kind of setting in Apache or PHP configuration? My
>error_reporting (in php.ini) is set to:

E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR

- Show quoted text -

Quote:

>Thanks in advance,

>--
>Ahd



Tue, 02 Aug 2005 03:52:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HELP looping through recordset for 2nd time

2. Strange link error every 2. time

3. Processing every time a record is read.

4. GPF in Clarion every time i do this

5. Clarion Rewrites CLW file Every time I load it

6. How do I acquire 1 image every time an external trigger fires

7. execute code every set time

8. VI that gets bigger every time it runs

9. random_seed() gives same seed every time

10. I catch nimda every time I surf

11. Primitive failed in: EmSystemConfiguration>>#loadComponentPrimitive: due to Not enough memory

12. update every second or every resched()?

 

 
Powered by phpBB® Forum Software