I have 2 laptops. One is windows and one is Linux(Ubuntu). On the windows machine I'm unable to run android emulator app. I have tried with http://localhost/
, http://10.0.2.2/
and none working. On Linux machine everything is work just fine. What can be the problem?
I have use Eclipse. And on machine localhost WAMP.
Update:
I have this code which I try to open via app. When I run it on my local i.e. http://localhost/file.php
obviously I get this error for deprecated mysql_*
function but the result is displayed (on the web host I don't get this errors). I've tried to turn of display_errors
in php.ini and I notice that the app doesn't crash anymore and all is running. Is it really possible this to cause the problem?
<?php
$objConnect = mysql_connect("localhost","database","");
$objDB = mysql_select_db("tableName");
$strSQL = "SELECT * FROM res";
$objQuery = mysql_query($strSQL);
$intNumField = mysql_num_fields($objQuery);
$resultArray = array();
while($obResult = mysql_fetch_array($objQuery))
{
$arrCol = array();
for($i=0;$i<$intNumField;$i++)
{
$arrCol[mysql_field_name($objQuery,$i)] = $obResult[$i];
}
array_push($resultArray,$arrCol);
}
mysql_close($objConnect);
echo json_encode($resultArray);
?>