Hej alla!
Något är inte som jag vill ha det :OO
<?php
$server = "localhost"; // MySQL hostname
$username = "***"; // MySQL username
$password = "***"; // MySQL password
$dbname = "***"; // MySQL db name
$db = mysql_connect($server, $username, $password) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$sql = "SELECT ip2nationCountries.country FROM ip2nationCountries,ip2nation WHERE ip2nation.ip < INET_ATON('".$_SERVER['REMOTE_ADDR']."') AND ip2nationCountries.code = ip2nation.country ORDER BY ip2nation.ip DESC LIMIT 0,1";
$countryName = mysql_result(mysql_query($sql), 0, 0);
// Output full country name
echo $countryName;
?>
Resultat:
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /export/vol1/unix/s/sneeze/public_html/test/test.php on line 40
Nån som vet vad jag har gjort för fel??