value is not stored automatically in the database after executing the script
<p>This is the  php code to show fb style like / unlike which works fine after inserting values in the database manually..but i want my values to be inserted and stored in the database automatically after executing the script</p>

<pre><code>include('db.php');
if($_REQUEST['postId'])
{
    $userip = $_SERVER['REMOTE_ADDR'];

    mysql_query("update likes set likes=likes+1 where post_id= ".$_REQUEST['postId']);

    mysql_query("INSERT INTO ip (userip,post_id) VALUES('".$userip."','".$_REQUEST['postId']."')");

    $total_likes = mysql_query("SELECT * FROM facebook_collapsed_likes where post_id = ".$_REQUEST['postId']." ");
    $likes = mysql_fetch_array($total_likes);
    $likes = $likes['likes'];
}
echo $likes;
</code></pre>
