class method call problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bananaphp
Forum Newbie
Posts: 2
Joined: Tue Sep 08, 2009 3:25 am

class method call problem

Post 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;
}
}
?>
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: class method call problem

Post by jackpf »

....

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

:dubious:
Post Reply