Form data not inserting into mysql database
<p>I got this script from some website for an invoicing system but cant get it to insert into my database please help</p>

<p>this inserts into the appropriate database, I have not yet created the database can any one give me the structure of the table and explain this code?</p>

<pre><code>&lt;?php  
    $query_ins = "INSERT INTO invoices SET status='Unpaid',";
    $query_ins .= "inv_date = '".$td."',VAT = '17.5',cid = '".$_POST['projectname']."',uID = '".$u_id."'";

    mysql_query($query_ins);
    $newID=mysql_insert_id();
    query_ins = "INSERT INTO invoices SET status='Unpaid',";
    $query_ins .= "inv_date = '".$td."',VAT = '17.5',cid = '".$_POST['projectname']."',uID = '".$u_id."'";

    mysql_query($query_ins);
    $newID=mysql_insert_id();

    $query_inv="INSERT INTO clientinv SET descr='".trim(addslashes ($_POST['descr']))."',";
    //I Dont understand this .=

    $query_inv .= "totwVAT = '".$totwvat."',totxVAT = '".trim (addslashes($_POST['totxvat']))."',finv='".$newID."'";
    if(mysql_query($query_inv)){
      header("location:allinv.php");//displays all invoices
    }else{
      echo mysql_error();
    }
    }
?&gt;
</code></pre>
