View Single Post
Old 11-28-2008, 12:04 AM   #10 (permalink)
Tanax
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

You don't set $this->dbquery anywhere.
You haven't even defined $dbquery anywhere.
You defined $query, which isn't used anywhere.
You used var $query, instead of private $query, which would be the most optimal choice.
When you disconnect, you disconnect $this->connection, which isn't set anywhere either, NOR defined.
You return your query results, even if it failed.

And lastly, I don't think you should echo ANYTHING AT ALL in your class. Classes are just a way of managing your data. Return DATA instead, and process the data in your controller file(in this case - index.php).

PHP Code:
if($query// meaning if it returned true
{

echo 
'Query successful!';

}

else
{

echo 
'Query failed..';


Just my opinion
__________________
Tanax is offline  
Reply With Quote
The Following User Says Thank You to Tanax For This Useful Post:
zxt3st (11-28-2008)