PHP database objects for a ODBC/Access??
| From: | Christian C. | Date: | Mon, 08 Oct 2001 17:01:46 +0000 |
| Subject: | PHP database objects for a ODBC/Access?? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-70375@lists.php.net to get a copy of this message | ||
Hello :c)
I have found a class for odbc database connectivity and im tring to make it
work...
but im getting a Undefined property error :
Warning: Undefined property: num_rows in c:\inetpub\wwwroot\dbodbc.php on
line 43
In my case line 43 is this: $this->num_rows += 1;
Why is that and how could i fix it??
From what i could see, num_rows is defined in my class but it's still not
working.
Any one know a good easy and fast PHP database objects for ODBC??
<?
class odbc {
/* Set connection variables */
var $record_set, $con_nect, $cur_sur, $dbtype, $num_rows, $current_rec,
$cur_field, $current_row;
/* Create an object to set the cursor of the database */
function cursorname($cursor){
$this->cur=$cursor;
}
...
function openrs($sqlstatement){
//var num_rows;
$this->record_set = odbc_exec($this->con_nek,$sqlstatement); /* get the
result */
while (odbc_fetch_row($this->record_set)){
$this->num_rows += 1; /* count the number of rows */
}
$this->current_rec = odbc_fetch_row($this->record_set,1); /* gets the
current row */
$this->current_row = 1; /* reset row (first row) */
return $this->record_set;
}
?>
Thanks
--
Merci
Christian Charette
www.charetx2.com