im sending data from my android application to mySQL in localhost and I receive warning on (Warning: mysql_free_result() expects parameter 1 to be resource, Boolean given in C:\xampp\htdocs\datatest.php on line 17)
despite the warning i'm still able insert the data into the database.
i'm wondering is it ok to ignore this or how can i solve this problem?
i tried various forums and website by none solve my problems.
<?php
$dbcnx = mysql_connect("localhost", "root", "");
$db = "agentdatabase";
mysql_select_db($db, $dbcnx);
$user_id=$_POST['username'];
$passwd=$_POST['password'];
$query = "INSERT INTO agentable (username,password) VALUES ('".$user_id."','".$passwd."')";
echo $query;
$result = mysql_query($query) or die ("<b>Query failed:</b> " . mysql_error());
if($result){
echo '<br />','pass';
}
else echo mysql_error();
mysql_free_result($result);
mysql_close($dbcnx);
?>