Page 1 of 1

class method call problem

Posted: Tue Sep 08, 2009 6:30 am
by bananaphp
hi i m new to php and i have made a connection class and i want to use its methods for connection and for queries but i dont know how to use them
pleaseguide me it will be thankful

<?
include("connect.php");
class sql
{
var $row, $result;

function sql($q="")
{
if($q!="")
{
$row = mysql_query($q);
}
}

function dbread()
{
$retval=false;

if($row)
{

$result = mysql_fetch_array($row);

if($result)
{

$retval=true;
}
}
return $retval;
}

function field($f="")
{
$retval=null;
if($f!="")
{
if($result)
{
$retval = $result[$f];
}
}
return $retval;
}

function destruct()
{
$$row=null;
$result=null;
}
}
?>

Re: class method call problem

Posted: Tue Sep 08, 2009 6:35 am
by jackpf
....

You've made a class which you don't know how to use...?

:dubious: