Jump to content

N00BY Question....


calumrouge

Recommended Posts

Hey,
I know that this is probably a really n00by question, and yes, before anyone asks I am a 13 year old kid trying to code fo himself. Any way! :P

I am quite new to PHP but I have created a MySql database on the server I am using, I have got the code need to connect to it:

[font=Courier New]mysql_connect(servername,username,password);[/font]

but I am not sure what to put for server name.

My main address is: calum.1111mb.com (Yes free hosting.)
My MySql Database is Called: calum_test
My Username is: Calum
My Password is: PRIVATE (Come on I'm not stupid!)
My Port For MySQL is: 3306

Could anyone please tell me what I need to put in my mysql_connect query for my database.

Thanks  ;D!

Link to comment
https://forums.phpfreaks.com/topic/29232-n00by-question/
Share on other sites

[quote author=calumrouge link=topic=117118.msg477575#msg477575 date=1165076513]
Hey,
I know that this is probably a really n00by question, and yes, before anyone asks I am a 13 year old kid trying to code fo himself. Any way! :P

I am quite new to PHP but I have created a MySql database on the server I am using, I have got the code need to connect to it:

[font=Courier New]mysql_connect(servername,username,password);[/font]

but I am not sure what to put for server name.

My main address is: calum.1111mb.com (Yes free hosting.)
My MySql Database is Called: calum_test
My Username is: Calum
My Password is: PRIVATE (Come on I'm not stupid!)
My Port For MySQL is: 3306

Could anyone please tell me what I need to put in my mysql_connect query for my database.

Thanks  ;D!


[/quote]

try "localhost"
Link to comment
https://forums.phpfreaks.com/topic/29232-n00by-question/#findComment-133997
Share on other sites

[quote author=calumrouge link=topic=117118.msg477575#msg477575 date=1165076513]
but I am not sure what to put for server name.

My main address is: calum.1111mb.com (Yes free hosting.)
My MySql Database is Called: calum_test
My Username is: Calum
My Password is: PRIVATE (Come on I'm not stupid!)
My Port For MySQL is: 3306
[/quote]On free hosting, it will most likey be "localhost". 3306 is the default port, so you don't need to set that.

$conn = mysql_connect("localhost", "Calum", "PRIVATE");
mysql_select_db("calum_test", $conn);
Link to comment
https://forums.phpfreaks.com/topic/29232-n00by-question/#findComment-134000
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.