Hello.
Hopefully some of you enlightened folks can help me with a concept that has been holding me back.
Every single PHP tutorial I've come across has been designed for a situation like XAMPP running on the machine with which you're coding. Therefore, the host name in the connection statement is "localhost". I haven't found anyone teaching how to code your connection if your site is hosted by a 3rd party.
At the top of PHPMyAdmin, the Server: is the top level domain that I'm using, whereas on the tutorials I've seen, Server: is localhost, which to me implies that it's only supposed to be "localhost" if you're coding on the serving box itself. My instinct tells me to construct my connection like this:
<?php
function connect(){
$con = mysql_connect("myDomain.com", "myUsername", "myPassword") or die(mysql_error());
$db = mysql_select_db("myDB", $con);
}
?>
Am I thinking about this wrongly?
Thanks in advance for your insight.
-Leko