IPB
Your Ad Here


Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
mysql_query: INSERT does not insert anything at all...
Misha Singh
post Nov 7 2009, 01:12 AM
Post #1


Advanced Member
***

Group: Members
Posts: 7,881
Joined: 23-November 08
Member No.: 6,521



Hi there,

I am able to read from my database table, but I am not able to write.

As far as I can see, my code is correct, and my database table has been set up correctly. However, when I test my script, nothing is inserted into my table. I have no idea what is wrong.

Can anyone figure out what is missing or incorrect in my SQL query?

My script is as follows:



PHP Code:





include("archive/file.inc");


$connection = mysql_connect($host, $account, $password)

or die(
mysql_error());


$db = mysql_select_db($dbname, $connection)

or die(
mysql_error());


$query = "INSERT INTO users (subscr_date, subscr_time, subscr_ip, signature, password, email, key, name, gender, dob, area) VALUES ('$subscr_date', '$subscr_time', '$subscr_ip', '$signature', '$password', '$email', '$key','$name', '$gender', '$dob', '$area')";


$result = $mysql_query($query)

or die(
mysql_error());


mysql_close($connection);








PHP version: 5.2
MySQL version: 5.0

Thank you very much in advance for any help.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
Tags
No Tag inserted yet

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st November 2009 - 11:10 AM
Your Ad Here