|
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.
Navigation:
[Reply to this message]
|