This might be a stupid question but, I am trying to connect to a database trough a PHP file:
<?php
$con = mysql_connect("host","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
$result = mysql_query("SELECT * FROM wp_posts");
while($row = mysql_fetch_array($result))
{
echo $row['post_title'] . " " . $row['ID'];
echo "<br />";
}
mysql_close($con);
?>
But I am getting the following error:
Could not connect: Unknown MySQL server host 'ijsselmondenieuws.nl/' (11004)
I am confused about what host I need to use. The website itself is www.ijsselmondenieuws.nl. For my own website I know its mysql50-c1.website.com.
Any help is appreciated!
Thanks,
Jef
The host will either by
localhostif the MySQL server is running on the same machine as the webserver, or a local IP address like192.168.xxx.xxxor10.xxx.xxx.xxx. Very rarely will the host be a name, in which case it’s most likely a computer name (for example mine isKOLINK-PC).