RE: [PHP] PHP database objects for a ODBC/Access??
| From: | Dana Holt | Date: | Mon, 08 Oct 2001 17:52:08 +0000 |
| Subject: | RE: [PHP] PHP database objects for a ODBC/Access?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70379@lists.php.net to get a copy of this message | ||
I wrote some classes some time ago, and I had a similar problem with my own
classes.
If I wrote something like:
class CSomething {
var $some_var;
function SomeMethod() {
$this->some_var = 1;
return;
}
}
It would tell me that $some_var wasn't defined. I had to give $some_var an
initial value before it worked.
class CSomething {
var $some_var = 0;
...
It worked fine like this. I thought it was strange.
Bug? Feature? I haven't dug into it. Anyone know?
--
Dana Holt / danah@home.com
Xenos Online
http://www.xenosonline.com/
---------------------------
-----Original Message-----
From: Christian C. [mailto:c@c.com]
Sent: Monday, October 08, 2001 12:02 PM
To: php-general@lists.php.net
Subject: [PHP] PHP database objects for a ODBC/Access??
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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net