Esto es lo que tengo:
CONFIG.PHP
Código PHP:
<?php
# Data config for connect to database server
$server = 'localhost'; # Server (default:localhost)
$user_prefix = 'user'; # User of hosting (default:test)
$username_mysql = $user_prefix.'_test'; # Mysql database user
$password_mysql = 'pass'; # Mysql database password
$database_mysql = $user_prefix.'_test'; # Mysql database
# Check database to host connection
if(!function_exists('mysql_connect'))
{
echo 'PHP cannot find the mysql extension. MySQL is required for run. Aborting.';
exit();
}
$conexion = @mysql_connect($server, $username_mysql, $password_mysql)
or die('Error: Database to host connection: '.mysql_error());
mysql_select_db($database_mysql, $conexion)
or die('Error: Select database: '.mysql_error());
?>
*************
INDEX.PHP
Código PHP:
<?php
require_once('config.php');
$ip = $_SERVER["REMOTE_ADDR"];
/* transformacion de la IP */
$dotted = preg_split( "/[.]+/", $ip);
$ip2 = (double) ($dotted[0]*16777216)+($dotted[1]*65536)+($dotted[2]*256)+($dotted[3]);
$query = mysql_query("SELECT country_name FROM IPTOCOUNTRY WHERE $ip2 BETWEEN $ip_from AND ip_to",$conexion);
$resultado = mysql_query($query, $conexion);
$row = mysql_fetch_array($resultado);
echo $row['country_name'];
?>
*********************
Y el error que me muestra es este:
Código:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/u205532958/public_html/media/img/index.php on line 13
(En la linea 13 esta esto:)
Links:
http://worldgame.besaba.com/media/img/index.php
Que es lo que puede estar mal??