# Problems with php/sql flash form

**URL:** <https://forum.kirupa.com/t/problems-with-php-sql-flash-form/160798>\
**Category:** Uncategorized\
**Created:** [August 29, 2005, 4:45pm UTC](https://forum.kirupa.com/t/problems-with-php-sql-flash-form/160798 "2005-08-29T16:45:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerry](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jerry](https://forum.kirupa.com/u/jerry)\
**Post date:** [August 29, 2005, 4:45pm UTC](https://forum.kirupa.com/t/problems-with-php-sql-flash-form/160798/1 "2005-08-29T16:45:11Z")

</div>

I can’t get this thing to work :crying: - any help would be nice…

My swf contains 3 input text fields with the var names of: nNavn, nMail, nKommentar - and a button with the following code:

```auto
on (release) {
	loadVariablesNum ("db.php", "0", "Post");
}

```

My php code looks like this:

```php
<?

// DATABASE CONNECTION INFO -------------------------------------
$DB_host = "localhost"; 	
$DB_username = "***"; 					
$DB_password = "***"; 					
$DB_name = "***"; 					
$DB_table = "form"; 					
//---------------------------------------------------------------

$db = mysql_connect( "$DB_host", "$DB_username", "$DB_password")
               or die( "Unable to connect to MySQL server on $DB_host");
mysql_select_db( "$DB_name") or die( "Unable to select database");

if ($act="view") {
	 echo "action not defined";
} else {
	$query = "INSERT INTO $DB_table (navn,mail,kommentar) VALUES ('$nNavn','$nMail','$nKommentar')";
	$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
} 

?>

```

And I have a table in my mySQL database with 3 rows navn,mail,kommentar.

NOTHING happens when I hit the button… :crying:
