Jump to content

Warning: Missing argument 1 for Radio_Core::__construct()


ChrisMartino

Recommended Posts

Hey there,

 

This has me stumped here. I'm supplying an array as a valid argument to the class like so:

 

$mysql_configuration = array(
'MySQL_Host' 		=> "localhost",
'MySQL_Username' 	=> "fdsfdsfsdfsd",
'MySQL_Password' 	=> "sdf-sdf543",
'MySQL_Database'	=> "sfsdfsdfsdf");

$radio_core = array('Main' => new Radio_Core($mysql_configuration), 'Requests' => new Radio_Requests, 'Accounts' => new Radio_Accounts, 'Content' => new Radio_Content);

 

And here is my small class:

 

class Radio_Core
{
public $mysql_handle;



function __construct($mysql_array)
{
	$this->mysql_handle = mysql_connect($mysql_array['MySQL_Host'], $mysql_array['MySQL_Username'], $mysql_array['MySQL_Password']);

	if(!$this->mysql_handle)
	{
		die("The station failed to connect to the MySQL database.");
	}
	else
	{
		mysql_select_db($mysql_array['MySQL_Database'], $this->mysql_handle);
	}

	return 1;
}
}

 

And when it is called I am prompted with the error that the argument is missing for it?

 

 

Warning: Missing argument 1 for Radio_Core::__construct(), called in /home/atomnetw/public_html/Chris-Martino.com/projects/radio/index.php on line 10 and defined in /home/atomnetw/public_html/Chris-Martino.com/projects/radio/Core/radio.class.php on line 15

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'atomnetw'@'localhost' (using password: NO) in /home/atomnetw/public_html/Chris-Martino.com/projects/radio/Core/radio.class.php on line 17

 

Thanks for your time!

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.