![]() |
Learning OOP the hard way! Please help
Hi,
I am designing my own CMS which i hope to release to the public, however this is my first project I have done using OOP... Here in Australia there is NO one Tafe or University course that teaches OOP, I am wondering if someone would be kind to help me find out why the following is not working I have the following files config.php dbopen.php dbclose.php index.php articals.php Now to explain what these files do. Config.php - has all the same things that Joomla has inside its config files. Just names a bit different and something left out, but looks the same. dbopen.php has the following code PHP Code:
PHP Code:
PHP Code:
the output in the index.php PHP Code:
makes this error. Fatal error: Call to a member function query() on a non-object in /home/desvisa/public_html/beta/system/articals/artical.php on line 15 which means this code PHP Code:
can someone please help |
Try:
PHP Code:
|
this was really a quick look into code:
$result=$DBData->query... $DBData is not an object is what the error says. It should be something like (check the rest of the code): $result = $this->DBData->query... but you need a variable: protected $DBData; somewhere... this variable should be an instance of $myObj... I also noticed confusion: dbopen.php or opendb.php ;-) |
Quote:
mmm i cant get it to work... |
Ok i have mysqli working, and man got to say alot easier then the old Mysql_Connect
this is my Mysqli code PHP Code:
the print $row['title']; is only printing out one title and I need it to print All the titles, in a array formate PHP Code:
Thanks |
PHP Code:
PHP tags added - please read http://www.talkphp.com/lounge/4563-p...e-talkphp.html |
Thanks for that Jamie,
I am getting a small error which I don't understand PHP Code:
|
I got this code to work
PHP Code:
|
Russel,
I don't know this class Mysqli. What does $mysqli->query return? A statement or a result? If is a result, the code should work passing back $result into fetch. Could you post Mysqli class declaration? PHP Code:
PHP tags added - please read http://www.talkphp.com/lounge/4563-p...e-talkphp.html |
Please follow the Rules of code tags..
Thank you, -CF |
| All times are GMT. The time now is 04:57 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0