HI There
I want to start using mysqli method to connect to my db . so far i had a complete class to use with mysql functions.
I tried to wrap the mysqli object as a custom class that query , return the rows as an array and so on.. but couldnt get a working one.
I need a class that use mysqli functions to connect, query , return rows array , and at the end closes the connection .
if anyone can help it would be Great
Thanks
Moshe
using mysqli as an extended class
Moderator: General Moderators
using mysqli as an extended class
HI
i tried to create a class:
i dont know how to create the method of returning rows.
thats what i need help in .
i tried to create a class:
Code: Select all
class db{
function db($host,$user,$pass,$dbname) {
$con=new mysqli(.....)
function GetRows() {
}thats what i need help in .
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
If your class is going to contain an object of mysqli, then you will need to set a property of the class to an instance of the object so other methods can access it.
The basic concept is thus
The basic concept is thus
Code: Select all
class foo
{
var $my = null;
function foo(..)
{
$this->my = new mysqli(..);
}
function bar(..)
{
return $this->my->someFunction();
}
}using mysqli as an extended class
Ok great ,
But what about the query / rows fetching method ? how it will work ?
But what about the query / rows fetching method ? how it will work ?