|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-11-30 21:41 UTC] fmk@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 13:00:01 2025 UTC |
i tried to include basic functions for connect, execute queries, fetch rows... in classes. whenver i execute on of the fetch functions : first time it works fine, the next call to fetchrow generates gpe. $GolbalConnection=null; class connection { function connection($Server,$UserName,$Password,$db) { global $GolbalConnection; $GolbalConnection=odbc_connect($Server,$UserName,$Password); } function getc() { return $GolbalConnection; } }; class recordset { var $res; function getr() { return $this->$res; } function open($q) { global $GolbalConnection; //settype($this->$row,"array"); $this->$res=odbc_exec($GolbalConnection,$q); if(!$this->$res) $this->$res=0; return $this->$res; } function fetchrow($r=0) { static $row; if($this->$res!=0) { if($r>0) { $t=odbc_fetch_row($this->$res,$r); } else { $t=odbc_fetch_row($this->$res); } } if(!$t) $row=null; else { $row=null; for($i=0;$i<odbc_num_fields($this->$res);$i++) { $nm=odbc_field_name($this->$res,$i+1); $row[$nm]=odbc_result($this->$res,$nm); } } return $row; } };