php code runs twice .....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bskhas
Forum Newbie
Posts: 5
Joined: Thu Aug 18, 2005 1:05 am
Contact:

php code runs twice .....

Post by bskhas »

Hi everyone ...

I am facing a problem. I have written a code of inserting data into database, when that page is loaded, it inserts the data successfully into the database, but not only once ... TWICE. Although i have written the query just once.

Can anybody help why this happens ?

Thanx ...
User avatar
AnarKy
Forum Contributor
Posts: 119
Joined: Tue Nov 02, 2004 1:49 am
Location: South Africa

POST CODE

Post by AnarKy »

HI,

Please post your code,
it may be a simple bug. :wink:
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

use a die(); at the end of the code.

Although, you should really debug your script instead of cheating like I would :-D
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

I hv come across this problem earlier but sadly I dont remember wot I did to cure that one :cry:

shd be a problem with the form submitting twice because of sth...pls post your code :)
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

Could be an extra iteration in a loop. There would really be no way of knowing until there were eyes on code.
Post Reply