subhomoy Posted March 8, 2014 Share Posted March 8, 2014 (edited) 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 When ever I queried the same ip in my server it shows nothing... As shown below.... 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... Edited March 8, 2014 by Ch0cu3r Quote Link to comment Share on other sites More sharing options...
bobo_liu Posted March 8, 2014 Share Posted March 8, 2014 sql:SELECT * from ip2country WHERE $ip BETWEEN begin_long_ip AND end_long_ip; Are you sure is not empty? Quote Link to comment Share on other sites More sharing options...
subhomoy Posted March 8, 2014 Author Share Posted March 8, 2014 (edited) yeah i'm 100% sure its not empty... Edited March 8, 2014 by subhomoy Quote Link to comment Share on other sites More sharing options...
subhomoy Posted March 9, 2014 Author Share Posted March 9, 2014 Anybody plz help me... Quote Link to comment Share on other sites More sharing options...
Solution mac_gyver Posted March 9, 2014 Solution Share Posted March 9, 2014 (edited) it's possible that your actual column names have different capitalization between the two servers. what does using the following - print_r($row);, immediately after the $row = mysql_fetch_array($res); statement show? Edited March 9, 2014 by mac_gyver Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.