NYCPHP Meetup

NYPHP.org

[nycphp-talk] mysql freakish error!

Phil Powell soazine at erols.com
Fri Sep 5 13:33:22 EDT 2003


This is the mySQL insert statement:

INSERT INTO nnet_usermetadata (nnet_user_uplinenumber, nnet_user_firstname,
nnet_user_lastname, nnet_user_email, nnet_user_address1, nnet_user_address2,
nnet_user_city, nnet_user_zip_postal, nnet_user_country,
nnet_user_homephone, nnet_user_workphone, nnet_user_fax, nnet_user_isAdmin,
nnet_record_entered) values ('', 'Phil', 'Powell', 'soazine at erols.com',
'Ryttarsgårdkyrkan', '', 'Linköping', '', 'SWE', '011-571-437-4430', '', '',
'0', 'now()')

And here is the SQL that created the table in the first place:

#  TABLE TO CONTAIN FINESOCCER.COM REGISTERED (AND TO BE REGISTERED) USERS
AND THEIR METADATA
create table if not exists nnet_usermetadata (
 nnet_userid int not null auto_increment,
 primary key(nnet_userid),
 nnet_username varchar(255),
 nnet_password varchar(255),
 nnet_user_firstname varchar(255) not null,
 nnet_user_lastname varchar(255) not null,
 nnet_user_email varchar(255) not null,
 nnet_user_address1 varchar(255) not null,
 nnet_user_address2 varchar(50),
 nnet_user_city varchar(255) not null,
 nnet_user_state_province varchar(255),
 nnet_user_zip_postal varchar(20),
 nnet_user_country varchar(255),
 nnet_user_homephone varchar(50) not null,
 nnet_user_workphone varchar(50),
 nnet_user_fax varchar(50),
 nnet_user_uplinenumber int default 0,
 nnet_user_registrationnumber int default 0,
 nnet_user_isRegisteredFromHome varchar(1) default '0',
 nnet_user_ip varchar(15),
 nnet_user_isAdmin varchar(1) not null default '0',
 nnet_record_entered datetime default 'NOW()'
);

alter table nnet_usermetadata add index ix_nnet_username(nnet_username);
alter table nnet_usermetadata add index ix_nnet_password(nnet_password);
alter table nnet_usermetadata add index
ix_nnet_user_firstname(nnet_user_firstname);
alter table nnet_usermetadata add index
ix_nnet_user_lastname(nnet_user_lastname);
alter table nnet_usermetadata add index ix_nnet_user_email(nnet_user_email);
alter table nnet_usermetadata add index ix_nnet_city(nnet_user_city);
alter table nnet_usermetadata add index
ix_nnet_user_state_province(nnet_user_state_province);
alter table nnet_usermetadata add index
ix_nnet_user_zip_postal(nnet_user_zip_postal);
alter table nnet_usermetadata add index
ix_nnet_user_country(nnet_user_country);
alter table nnet_usermetadata add index
ix_nnet_user_uplinenumber(nnet_user_uplinenumber);
alter table nnet_usermetadata add index
ix_nnet_user_registrationnumber(nnet_user_registrationnumber);
alter table nnet_usermetadata add index
ix_nnet_user_isRegisteredFromHome(nnet_user_isRegisteredFromHome);
alter table nnet_usermetadata add index ix_nnet_user_ip(nnet_user_ip);

HTH

Phil
----- Original Message ----- 
From: "Chris Shiflett" <shiflett at php.net>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Friday, September 05, 2003 1:31 PM
Subject: Re: [nycphp-talk] mysql freakish error!


> --- Phil Powell <soazine at erols.com> wrote:
> > I have never in my life ever seen this happen, but I am doing a typical
> > mySQL insert statement:
> >
> > insert into nnet_usermetadata (
> >  ...
> > ) values (
> > ....
> > )
> >
> > if (!mysql_query(sql)) { // DO STUFF}
> >
> > the ID column field, nnet_userid, is an int auto-increment.
> >
> > This is where I have never in my career seen this happen before. The
> > INSERT statement, upon execution, literally writes on top of another
> > existing row, so instead of 5 or 6 rows I have only 1 row, same ID,
> > values changed!
>
> Show us some sample code. :-)
>
> Chris
>
> =====
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk




More information about the talk mailing list