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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.