Forum Moderators: coopster & phranque

Message Too Old, No Replies

Duplicate db entries

why might this happen

         

Nick_W

1:08 pm on Jun 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all,

I have a very simple insert statement from php to a mysql db. It is inserting 2 entries every time is is run though?

There is nothing wrong with the code at all so I can't fathom what's causing this, anyone think of anything it might be? If I insert directly from the mysql server it works fine?

Nick

The Contractor

1:13 pm on Jun 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nick
<<There is nothing wrong with the code at all so I can't fathom what's causing this>>

If it works entering directly it would have to be the code. I don't know PHP so I'm no help :)

Knowles

1:21 pm on Jun 13, 2002 (gmt 0)

10+ Year Member



By any chance do you have it in a loop? Just a guess and I am guessin you dont since it only does it twice. Other than that its gotta be something to do with the way its pharsing. Possibly is it a var thats beening called twice?

Nick_W

1:47 pm on Jun 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



GODDAMMMIT!

Would you believe it appears to be a Moxilla thing? I just tested it in lynx and it has no trouble at all!

Seems like Moz is loading the page twice, any thoughts on that guys?

Nick

Knowles

2:42 pm on Jun 13, 2002 (gmt 0)

10+ Year Member



I just saw your other post saying the same. I am at a lose now. Maybe kick mozilla and see if that helps?

DrDoc

2:55 am on Jun 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What would make MZ load the page twice though?

Any code samples?

Lisa

6:42 am on Jun 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Uh, you might want to insert a unique key, Have that field unique, Then only one entry can be inserted.

Insert into temp.test values (‘test’, ‘Go for it’, ‘aidxjluw18sl’)

If field three is unique then this statement only works once. Maybe try a primary key, or a multi-primary key. That is how I would get around it.

Nick_W

6:54 am on Jun 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nope, I'm afraid it was my own abject stupidity.
Well, not really, I think it was an pretty odd mistake to make...

I had this in the html (last place you'd look right?)

<link rel="stylesheet" href="" />

So it was calling itself everytime it loaded!

Doh!

Nick

Knowles

1:46 pm on Jun 18, 2002 (gmt 0)

10+ Year Member



LOL Nick I just read this. Dont you hate when it so simple?

Nick_W

2:46 pm on Jun 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Especialy when you spend neigh on 3hrs swearing at it, threatning, posting on all the boards for help etc....

Sheesh!