Reply to Re: Duplicate records added from post forms, easy solutions?

Your name:

Reply:


Posted by rik.catlow@gmail.com on 07/16/06 16:25

You can add an if to check the database if the has the record already.

$query_check = "SELECT * FROM `contest` WHERE record='$record'";
$query = @mysql_query($query_check) or die("Could not check for
account in our database.");

if (mysql_num_rows($query) > 0) {
$rv echo "That record is already in the database";
}

Well something like that...



mindwarp wrote:
> Hi,
>
> When a user submits / posts data my php script Inserts data into my
> database.
> If they refresh the script or click back and click submit again I get
> duplicate record.
>
> Is there an easy solution to this?
>
> Or do I need to create a hidden field which contains some sort of
> unquie data, like a time stamp and have a have a unique field which
> stops it adding the record?
>
> Best regards,
>
> Jules.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация