Jump to content

Unknown problem facing with my database...


subhomoy

Recommended Posts

Hello every body

I have a database and it consist of more than 200,000 rows and the problem i'm facing is that whenever i'm quering the database from my localhost it shows correct output but whenver i'm, uploading them in the server, it misses some output...

The image is shown below...

 

In my localhost

 

cqs1394261777m.jpg

 

When ever I queried the same ip in my server it shows nothing... As shown below....

 

viu1394261901d.png

 

The code i'm using to query is shown below

<?php
$con = mysql_connect("***","****","****") or die(mysql_error());
 mysql_select_db("****") or die(mysql_error());
 ?>
 <div style="margin: 0px auto;width: 980px;">
<form method="post" action="">
    Enter the ip <input type="text" name="ip" size="35" style="height:28; font-size: 18px"/><input type="submit" name="submit" value="Check Country" style="height: 30px; margin-left: 15px;" />
</form>

<?php
    if(isset($_REQUEST['submit']))
    {
	$ip = ip2long($_REQUEST['ip']);
	
	$res = mysql_query("SELECT * from ip2country WHERE $ip BETWEEN begin_long_ip AND end_long_ip") or die(mysql_error());
	$row = mysql_fetch_array($res);
	echo "<h1>Country Name :  ".$row['country_name']."</h1><br />";
	echo "<h1>Country Code :  ".$row['country_code']."</h1><br />";	

	$res1 = mysql_query("SELECT COUNT(*) AS Total FROM ip2country") or die(mysql_error());
	$row1 = mysql_fetch_array($res1);
	echo $row1['Total'];
    }
?>
</div>

Any help will be greatly appreciated....

Thank you in advance... :)

Link to comment
https://forums.phpfreaks.com/topic/286810-unknown-problem-facing-with-my-database/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.