MySQL Forums
Forum List  »  PHP

phantom insert
Posted by: Jonathan T
Date: January 06, 2006 03:43PM

Am I allowed to ask questions that refer to PHP?

Here is my table:

CREATE TABLE `users` (
`id` tinyint(6) NOT NULL auto_increment,
`username` varchar(20) NOT NULL default '',
`password` varchar(64) NOT NULL default '',
`last_name` varchar(32) NOT NULL default '',
`first_name` varchar(32) NOT NULL default '',
`email` varchar(64) NOT NULL default '',
`major_id` tinyint(6) default NULL,
`minor_id` tinyint(6) default NULL,
`exp_grad` date default NULL,
`phone` varchar(32) default NULL,
`address` varchar(64) default NULL,
`city` varchar(32) default NULL,
`state` char(2) default NULL,
`zip` varchar(12) default NULL,
`reg_date` timestamp(14) NOT NULL,
`birthdate` date default NULL,
`suspended` tinyint(1) NOT NULL default '0',
`confirmed` tinyint(1) NOT NULL default '0',
`accttype_id` tinyint(1) NOT NULL default '0',
`paypal_email` varchar(64) default NULL,
`school_id` tinyint(6) NOT NULL default '0',
`notification_id` tinyint(6) NOT NULL default '1',
`regID` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=InnoDB AUTO_INCREMENT=7 ;

Here is my script:

<?php
$query="INSERT INTO users VALUES(NULL, '$username', '$md5pass', '$last_name',
'$first_name', '$email', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
'0', '0', '$accttype_id', NULL, '1', '1', '$regID')";
$result=mysql_query($query);
?>

The result of this query is two rows. The first is correct. The second has all the data from the insert, except username, last_name, first_name, email, and accttype_id.

Why is it adding the second, near blank, row? Do I need to include more of the script to help?

Thanks in advance!

Options: ReplyQuote


Subject
Written By
Posted
phantom insert
January 06, 2006 03:43PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.