**Code 1:**

```

<?php
class dbConnect {
  var $dbHost = 'localhost',
  $dbUser = 'root',
  $dbPass = '',
  $dbName = 'input_oop',
  $dbTable = 'users';
  function __construct() {
```

$dbc = mysql\_connect($this->dbHost,$this->dbUser,$this->dbPass) or die ("Cannot connect to MySQL : " . mysql\_error());
 mysql\_select\_db($this->dbName) or die ("Database not Found : " . mysql\_error());
 }
 }
class User extends dbConnect {
 var $name;
 function userInput($q) {
 $sql = "INSERT INTO $this->dbTable set name = '".$q."'";
 mysql\_query($sql) or die (mysql\_error());
 }
}
?>

This is the code to call the class.

```

<?php
include ('class.php');
$q=$_GET["q"];
$user = new User;
  $user->userInput($q);
?>

```

**Code 2:**

```

<?php
  $q = $_GET['q'];
$dbc=mysql_connect("localhost","root","") or die (mysql_error());
  mysql_select_db('input_oop') or die (mysql_error());
  $sql = "INSERT INTO users set name = '".$q."'";
  mysql_query($sql) or die (mysql_error());
?>

```

My **Code 1** save in my database:  

![alt text](https://i218.photobucket.com/albums/cc173/watanabe123/1.jpg)  

Saving Multiple!

My **Code 2** save in my database:  

![alt text](https://i218.photobucket.com/albums/cc173/watanabe123/2-1.jpg)  

**What is wrong with my code 1?**