# Sending data to Database on form submit Issue

**URL:** <https://forum.kirupa.com/t/sending-data-to-database-on-form-submit-issue/283322>\
**Category:** programming\
**Created:** [March 4, 2009, 10:18pm UTC](https://forum.kirupa.com/t/sending-data-to-database-on-form-submit-issue/283322 "2009-03-04T22:18:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashdaddy](https://avatars.discourse-cdn.com/v4/letter/f/e36b37/32.png) [@flashdaddy](https://forum.kirupa.com/u/flashdaddy)\
**Post date:** [March 4, 2009, 10:18pm UTC](https://forum.kirupa.com/t/sending-data-to-database-on-form-submit-issue/283322/1 "2009-03-04T22:18:32Z")

</div>

Hey All,

I have a Flash form that when submitted, the data goes to my email address. That’s working fine, however, I’m trying to send the data to my database as well. It appears that I’m missing something, here is what I have so far:

```php
    <?php
    require_once('Connections/con_jcol.php');
    $destinationAdress="my_email@domain.com";

    $nowDay = date("m.d.Y");
    $nowTime = date("H:i:s");

    $fullName = $_POST['fullName'];
    $phone = $_POST['phone'];
    $email = $_POST['email'];
    $message = $_POST['message'];
    
    

    $FormContent = "Message date = $nowDay at $nowTime
    ----------------------------------------------------------------------------
    From: $fullName
    Phone Number: $phone
    Primary Email Address: $email
    ----------------------------------------------------------------------------
    Question: $message";
    mail($destinationAdress, "$subject [My Domain Form Submission from $fullName]", $FormContent, "From: $email");
    
    if (!$conn_jcol)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    mysql_pconnect("my_db", $conn_jcol);
    
    mysql_query("INSERT INTO tbl_contacts (name, email, phone, message, date)
    VALUES ($fullName, $phone, $email, $message, $nowDay)");
    
    mysql_close($conn_jcol);
    ?>

```

Can someone please tell me what I’m doing wrong. I’ve been working on this for the past 3 hours
