title: WHERE clause in INSERT statement using mysql/php
body: <p>After searching on Google, i came to know that,
  I can not use a WHERE clause in my INSERT query..
  But i want to insert a value on column "Book_4" where "Student_ID = 1"</p>
  
  <p>How can i do that ??
  Is there any alternate to do that ?</p>
  
  <p>Will be Thankful to You !</p>
  
  <pre><code>$Query = "INSERT INTO issued_books (Book_4) VALUES ('$IssuedBookNumber')" ;
  </code></pre>
  
  <p><strong>EDITED:
  More Details</strong>
  Using insert query, when i insert a value in column "Student_ID" in my table. All columns in the row of Student_ID (except Student_ID) shows 0 in my DB.
  I dun know what this 0 means according to DB.
  It might be Null or numeric 0.
  If it is a numeric 0, then it should be updated using the UPDATE statement.
  But whenever i'm trying to update it, it never updates using UPDATE statement. That's why i'm asking !</p>
  
  <p>P.S: All columns have Datatype INT.</p>
  
  <p>Hope you understand what i want to say :)</p>
  
  <p>Here is the complete code.
  Suppose: Student_ID is already created having the value 2.
  IssuedBookNumber = 51</p>
  
  <p>Using the above values:
  Result = A new row is created having all columns 0 except the column "IssuedBookNumber" that is having value = 51.</p>
  
  <p>While i want, the result should be:
  On row Student_ID = 2, Book_4 should be 51.</p>
  
  <p>The point is, When i inserted a value on Student_ID, all other columns becomes 0 on the same row. But when any of the column on the same row having any number except the 0 (that was automatically came on all columns when i inserted a value in Student_ID). Update Query will work.. !</p>
  
  <pre><code>$IssuedBookNumber = $_POST['IssuedBookNumber'];
       $Student_ID = $_POST['StudentId'];
  
       $FetchingQuery = "SELECT * FROM issued_books WHERE Student_ID='" . $Student_ID . "'";
  
       $RunFetchingQuery = mysql_query($FetchingQuery);
  
  
       while ( $row = mysql_fetch_array( $RunFetchingQuery ) ) {
  
            $Book_1 = $row[ 'Book_1' ];
            $Book_2 = $row[ 'Book_2' ];
            $Book_3 = $row[ 'Book_3' ];
            $Book_4 = $row[ 'Book_4' ];
            $Book_5 = $row[ 'Book_5' ];
  
            }
  
            if(!empty($Book_4))
            {
                 $Update =  "UPDATE issued_books SET Book_4='$IssuedBookNumber' WHERE Student_ID= '$Student_ID'";
               mysql_query ($Update);
            }
  
            else
            {
                 $AddQuery = "INSERT INTO issued_books (Book_4) VALUES ('$IssuedBookNumber')";
      mysql_query ($AddQuery);
            }
  </code></pre>