Heya all!
I'd like to run this problem through you guys....just to see if you can make sense of it. What could I be doing wrong here? The table is setup as follows:
+------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+---------------+------+-----+---------+----------------+
| id | int(7) | | PRI | 0 | auto_increment |
| fname | varchar(50) | | | | |
| mname | varchar(50) | YES | | NULL | |
| lname | varchar(50) | YES | | NULL | |
| bday | date | YES | | NULL | |
| city | varchar(50) | YES | | NULL | |
| country | varchar(50) | YES | | NULL | |
| occupation | varchar(100) | YES | | NULL | |
| email | varchar(75) | YES | | NULL | |
| hobbies | text | YES | | NULL | |
| other | text | YES | | NULL | |
| signed_up | timestamp(14) | YES | | NULL | |
| password | int(32) | | | 0 | |
| state | varchar(50) | YES | | NULL | |
+------------+---------------+------+-----+---------+----------------+
and the code that gets the info from a form is:
//encrypt the password
$password=md5($password);
// open a connection to the database
$connection = mysql_connect($server, $user, $pass) or die("Cant connect");
// formulate the SQL query
$query = "INSERT into ilgunas (fname, mname, lname, bday, city, state, country, occupation, email, hobbies, other, password) VALUES
('$fname', '$mname', '$lname', '$bday', '$city', '$state', '$country', '$occupation', '$email, '$hobbies', '$other', '$password')" o
r die ("String wrong");
// run the query on the database
$result = mysql_db_query($db,$query ,$connection) or die("Error in query");
// close connection
mysql_close($connection);
echo "nice Job";
The result is "Error in query". I've been over this syntax a million times it seems, am I missing something obvious?