Jump to content

PHP Class Question


Dubya008

Recommended Posts

I'm starting to use a class to perform DB functions because I think it is more efficient. I found this class on the internet and understand pretty well what is going on. My problem is that I can't put the results on the screen when I use the class. (I can do it with out using the class but I'd like to learn to use it)

function fetch($info) {
        return mysql_fetch_array($info);

 

this is how I'm attempting to use it

 

$db = new mysql;
$db->connect();

while($row = $db->fetch($db->query("SELECT * FROM Attributes")))
{
echo $row['Attribute']."<br>";
}

This just echos the first row forever and I'm not sure how else to go about this. Any help would be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/210908-php-class-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.