# Add to database

**URL:** <https://forum.kirupa.com/t/add-to-database/107094>\
**Category:** Uncategorized\
**Created:** [April 12, 2004, 9:04am UTC](https://forum.kirupa.com/t/add-to-database/107094 "2004-04-12T09:04:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flaxcreatures](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/flaxcreatures/32/448_2.png) [@flaxcreatures](https://forum.kirupa.com/u/flaxcreatures)\
**Post date:** [April 12, 2004, 9:04am UTC](https://forum.kirupa.com/t/add-to-database/107094/1 "2004-04-12T09:04:54Z")

</div>

Hi there this is my script in php:

```php

<?php
$connection = mysql_connect("localhost", "xxxxxxx", "xxxxxxx") or die("no connection possible");
mysql_select_db("flaxcrea_flash", $connection) or die ("Kan geen tabel openen");
	
$name = "pieter";
$email = "skynet.be";

$insert_data = "
				INSERT INTO messages (naam, email, message, website, phone, buddy, date, time, country, ip) 
				VALUES ('$name', '$email', '$bericht', '$site', '$phone', '$buddy', '$date', '$time', '$location', '$ip')";

//echo("$name, $email, $bericht, $site, $phone, $buddy, $date, $time, $location, $ip");

mysql_query($insert_data) or die("Can't insert the new row ");
mysql_close($connection);

?>

```

if I execute the file in my browser a new line will be added in the database but, if I try to exec it from flash with loadvars, it doesn’t works

this is what I’ve already tried:

```auto
 

this.loadVariablesNum("addToDataBase.php", "POST");
this.loadVariablesNum("addToDataBase.php");

```

Do I do something wrong?
