Jump to content
MakeWebGames

Recommended Posts

Posted

hi i get a warning message on some files that probably use mysql

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'mysql_host' (1) in /home/nicholas/public_html/mysql.php on line 2

Unknown MySQL server host 'mysql_host' (1)

 

<?
$c=mysql_connect('mysql_host','mysql_user','mysql_pass') or die(mysql_error());
mysql_select_db('mysql_db',$c);
?>

 

can anyone help me find the problem?

Posted

Re: mysql help?

<?

$c=mysql_connect('localhost','cpanelusername','cpanelpassword') or die(mysql_error());

mysql_select_db('cpanelusername_database',$c);

?>

Doubt anyone is going to give you their file information lol.

Posted

Re: mysql help?

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'cpanelusername'@'localhost' (using password: YES) in /home/nicholas/public_html/mysql.php on line 2

Access denied for user 'cpanelusername'@'localhost' (using password: YES)

i get that now lol, this mysql.php file is kinda getting annoying lol. all my other files are good apart from this stupid mysql.php file lol

also u never know if they would, they might be kind and let me use it lol, they could also tell me it in a private message.

Posted

Re: mysql help?

Your username and password combination is a unique value, therefor you cannot use some-one elses.

You should ask your hosting provider's support center to set them up for you, or you should Google a few PHP & MySQL tutorials and learn how to do it by yourself.

Posted

Re: mysql help?

<?

$c=mysql_connect('mysql_host','mysql_user','mysql_pass') or die(mysql_error());

mysql_select_db('mysql_db',$c);

?>

what so for example say my

hostname is = localhost

database name is = ****

username is = ****

password i set was = ****

it should turn out like this?

<?

$c=mysql_connect('localhost','****','****') or die(mysql_error());

mysql_select_db('***',$c);

?>

Details Removed - Spudinski

Posted

Re: mysql help?

 

lol you just gave away all you cpanel details

Maybe he didn't maybe he just filled it in :-o

if he just filled it in then thats good but if not i would advise him to change his details because alot of people would try to steal your files/delete them

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.   Paste as plain text instead

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