Jump to content

Fatal error: Call to a member function on a non-object in.


seangworld

Recommended Posts

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 information
include("../univ_classes/connect.php");
// Include for mySQL database class
include("../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.  :)
$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.

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.