# A (probably) simple PHP script problem

**URL:** https://forum.kirupa.com/t/a-probably-simple-php-script-problem/104501
**Category:** Uncategorized
**Created:** [March 16, 2004, 10:06pm UTC](https://forum.kirupa.com/t/a-probably-simple-php-script-problem/104501 "2004-03-16T22:06:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jaelle](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jaelle](https://forum.kirupa.com/u/jaelle)
#### Post date: [March 16, 2004, 10:06pm UTC](https://forum.kirupa.com/t/a-probably-simple-php-script-problem/104501/1 "2004-03-16T22:06:50Z")

</div>

I’ve recently been playing around with PHP in an almost vain attempt to learn it. For the past 2 days I have been fighting w/ this very simple script to insert some data into a database, and I have no idea why it doesn’t. If someone could easily point out the problem, it’d be much appreciated.

```php
<?php 
			require("config.php");
			mysql_connect($mysql["host"], $mysql["user"], $mysql["pass"]) or die("MySQL connection failed. Some info is wrong");
			$table="members";
			$user=$_POST['username'];
			$passwd=$_POST['pass'];
			$mail=$_POST['email'];		
			$query = "INSERT INTO $table (id, username, pass, email) VALUES('','$user', '$passwd', '$mail')";
			mysql_query($query) or die("Could not insert information into table");
			echo "<br> Content was sucessfully inserted";
?>

```

If you want to see what it does, just press the Submit button [here.](http://www.jlcreationsonline.com/comicproject/?id=register)

It just outputs the error message “Could not insert information into table”

I’ve used this script before and it has worked. So I am at a loss as to know what to do. Help is much appreciated. Thanks!
