You could use a session var and set this to "false" once you used your (mysql_)query.
And put the function between an if statement, that only executes if the session var is true.
Once the record is added, the session var is set to false and any other request from that same user would be ignored.
Javascript is a nice way as Arni suggested, but have you seen the stats lately of how many people use their browser with javascript disabled? It's not secure enough if someone wants to flood your database this way, they simply disable their javascript and abuse your form anyway.
HTH,
Martin.