Jump to content

sql/php error


pouncer

Recommended Posts

Fatal error: Call to a member function on a non-object in c:\domains\mysite.com\wwwroot\myftpname\php_classes\class_registration.php on line 89
line 89/90 is

[code=php:0]
$msg = $func->RegistrationMessage($Username);
$func->SendPrivateMessage("John", $Username, "Welcome to Collectors Unite!", $msg);
[/code]

at the top of class_registration.php i have

require_once('php_classes/class_functions.php');
$func = new Functions();

and in class_functions.php i have

[code=php:0]
<?php

require_once("php_classes/class_db.php");

DB::Connect();

class Functions {
// Send a private message to a user.
function SendPrivateMessage($From_, $To_, $Subject, $Message) {
$privmessage = mysql_query("INSERT INTO private_messages (From_, To_, Subject, Message, Date_Sent) VALUES('$From_', '$To_', '$Subject', '$Message', now())") or die (mysql_error());
}

function RegistrationMessage($Username) {
return "Welcome to Collectors Unite $Username.<br>";
}
}

?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/28338-sqlphp-error/
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.