473,409 Members | 2,022 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

PHP/mySQL freakish error

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
3 2059
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Cathy Hui | last post by:
Do u know why do i get the following message when trying to build the MySql-Python (1.2.0) on my Solaris 8 system? (with mysql 4.0.21 and python 2.4). thanks! error mesg: ld: fatal:...
0
by: Lenz Grimmer | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, MySQL 4.0.14, a new version of the popular Open Source/Free Software Database, has been released. It is now available in source and binary...
0
by: Stefan Hinz | last post by:
Degan, jumping in to try and solve some problems that look pretty obvious to me ... > #options for default service (mysqld2) > (mysqld2) It should be , not (mysqld2).
0
by: Dennis Francis B. Tutanes | last post by:
$B$*@$OC$K$J$C$F$*$j$^$9!#(B $B%D%?%M%9(B@TSTI$B$G$9!#(B SEND-PR: -*- send-pr -*- SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as SEND-PR: will all comments (text...
4
by: Adam Smith | last post by:
I have a dedicated server running 'FreeBSD 4.9 STABLE' at a hosting site. They have done some default installations, presumably from the CVS ports package ??. Herein lies the problem, "I do not...
1
by: jiing | last post by:
Now let me describe what I have done and my purpose: Originally, I want to user ports to install phpBB But I found that phpBB doesn't support mysql 5.x (but the ports installed mySQL 5.0.0...
3
by: =?Utf-8?B?UmFnYQ==?= | last post by:
Hi, We have found a very freakish ‘truncate’ behavior in Classic ASP application (that is called from within a web logic portal). We have an ASP variable, lngOrderId (an oracle sequence...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
1
by: Steve Ametjan | last post by:
I've been trying to get MySQL-python to install on Leopard for the past couple of days, and I keep running into relatively the same error. I'm hoping that someone on this list will be able to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.