Help me. I have this simple PHP code for connecting to a MySQL database. It works very well on localhost, but when connection to a remote MySQL server, it cannot returns the right result. The output is
It connected to the server, seleted the db sucessfully, but there is nothing in the result (my table is not empty of course). I don't know what can I do to make it works with remote MySQL servers. Can anyone help me to sort it out please. Thank you very very much.
This is the code:
Connected Selected Quereied
Warning: Supplied argument is not a valid MySQL result resource in d:\inetpub\wwwroot\check.php on line 9
It connected to the server, seleted the db sucessfully, but there is nothing in the result (my table is not empty of course). I don't know what can I do to make it works with remote MySQL servers. Can anyone help me to sort it out please. Thank you very very much.
This is the code:
PHP:
<?php
$inlink = mysql_connect("www.freesql.org","name","pass") or die("Cannnot connect");
echo("Connected\n");
mysql_select_db("dbname") or die("Cannot select");
echo("Selected\n");
$display_query = "SELECT * FROM tablename";
$display_result = mysql_query($display_query);
echo("Quereied\n");
$display_row = mysql_fetch_array($display_result);
?>