By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,949 Members | 1,838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,949 IT Pros & Developers. It's quick & easy.

PHP/mySQL freakish error

P: n/a
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!

The way it works is that once a new user is pre-registered, their
information is stored in the db, a cookie is set with their userID (the
infamous permanent cookie) and then they're shown a screen w/ link to click
to go to the next page. They can then click onto the "Registrer" link and
edit their pre-registration information based upon the cookie stored in
their machine and submit. Once submitted this time it updates their
information instead of inserts.

I've checked my code and writing on top of an existing row should NOT happen
unless a cookie is set on their machine with their userid. In short, if I
pre-register for the first time I should have a cookie with userid of 1. If
Sven pre-registers for the first time on HIS machine he should have a cookie
with userid of 2. and so on.

So, uh, HELP!

Phil
Jul 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
your code probably has errors
why dont you let us see so we can help you more?

"Phil Powell" <so*****@erols.com> wrote in message
news:3Q26b.122081$xf.26618@lakeread04...
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!

The way it works is that once a new user is pre-registered, their
information is stored in the db, a cookie is set with their userID (the
infamous permanent cookie) and then they're shown a screen w/ link to click to go to the next page. They can then click onto the "Registrer" link and
edit their pre-registration information based upon the cookie stored in
their machine and submit. Once submitted this time it updates their
information instead of inserts.

I've checked my code and writing on top of an existing row should NOT happen unless a cookie is set on their machine with their userid. In short, if I
pre-register for the first time I should have a cookie with userid of 1. If Sven pre-registers for the first time on HIS machine he should have a cookie with userid of 2. and so on.

So, uh, HELP!

Phil

Jul 16 '05 #2

P: n/a
anti-bozak wrote:
your code probably has errors
why dont you let us see so we can help you more?


Particulary the definition for this particular table. To Phil: have you
tried doing a dump of the actual SQL statements that you are sending to
your server? Many problems arise there that becomes rather obvious looking
at the raw SQL statements directly.

-Fred

--
Shameless plug:
http://JobMarketIntelligence.com
A database of high-tech firms at your fingertips.
Jul 16 '05 #3

P: n/a
The immediate red-flag I see is that (sql) should probably be ($sql), eh?

-Paul Bramscher
Phil Powell 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!

The way it works is that once a new user is pre-registered, their
information is stored in the db, a cookie is set with their userID (the
infamous permanent cookie) and then they're shown a screen w/ link to click
to go to the next page. They can then click onto the "Registrer" link and
edit their pre-registration information based upon the cookie stored in
their machine and submit. Once submitted this time it updates their
information instead of inserts.

I've checked my code and writing on top of an existing row should NOT happen
unless a cookie is set on their machine with their userid. In short, if I
pre-register for the first time I should have a cookie with userid of 1. If
Sven pre-registers for the first time on HIS machine he should have a cookie
with userid of 2. and so on.

So, uh, HELP!

Phil


Jul 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.