mysql_free_result() expects parameter 1 to be resource
<p>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)</p>

<p>despite the warning i'm still able insert the data into the database.</p>

<p>i'm wondering is it ok to ignore this or how can i solve this problem?</p>

<p>i tried various forums and website by none solve my problems.</p>

<pre><code>&lt;?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 ("&lt;b&gt;Query failed:&lt;/b&gt; " . mysql_error());

if($result){
    echo '&lt;br /&gt;','pass';
}
else echo mysql_error();

mysql_free_result($result);
mysql_close($dbcnx);
?&gt;
</code></pre>
