seangworld Posted December 21, 2006 Share Posted December 21, 2006 hi, i was hoping someone could help me here. i've been struggling with this and have tried several different things but i keep getting different errors, so i reverted back to my original error lol.ok...i load up the index page and i get this:[quote]Fatal error: Call to a member function on a non-object in /home/www/seangworld/onslaught/index.php on line 11[/quote]on line 11 it says this:[quote]$db->connect();[/quote]for a bigger picture, this is what's before that:[quote]<?// Include global connection informationinclude("../univ_classes/connect.php");// Include for mySQL database classinclude("../univ_classes/mysqlDB.php");// Create new database object$db = mysql_connect($connection["localhost"], $connection["seangworld"], $connection["mypassword"], $dbNames['onslaught']);// Delete connection information$connection = NULL;$db->connect();[/quote]so, i await your advice. :) Link to comment https://forums.phpfreaks.com/topic/31466-fatal-error-call-to-a-member-function-on-a-non-object-in/ Share on other sites More sharing options...
trq Posted December 21, 2006 Share Posted December 21, 2006 $db is not an object so trying to invoke a method with it will not help. If your trying to use a mysql class then you wont need to call mysql_connect(), you might try reading the instructions for it though as we can't really help you much unless your using native php.You need to do some tutorials on how to connect to a database. The manuals entries for [url=http://php.net/mysql_connect]mysql_connect[/url] and [url=http://php.net/mysql_select_db]mysql_select_db[/url] should get you started. Link to comment https://forums.phpfreaks.com/topic/31466-fatal-error-call-to-a-member-function-on-a-non-object-in/#findComment-145752 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.