|
Posted by Betikci Boris on 12/21/07 16:54
On Dec 21, 2:57 am, "tes...@hotmail.com" <tes...@hotmail.com> wrote:
> I have my PHP inserting into Oracle 9i.
> But how do I prevent duplicate record entries?
>
> I only have 3 fields in the insert in the action page:
>
> CODE
> <?php
> $c=OCILogon("scott", "tiger", "orcl");
> if ( ! $c ) {
> echo "Unable to connect: " . var_dump( OCIError() );
> die();
> }
>
> $s = OCIParse($c, "INSERT INTO personTable
> (firstname,lastname,emailaddress) VALUES
> ($_POST[firstname],'$_POST[lastname]','$_POST[emailaddress]'");
> OCIExecute($s, OCI_DEFAULT);
> echo "Record successfully entered";
> ?>
>
> How do I prevent duplicate record info and show the user they entered
> duplicate info.
You have to compare the entries considering the time, the remote
address and the values, if all the same (for time consider seconds
indeed) it will show a possible sql injection first entry must be
saved the other must be deleted.. Rest is few scripting.. ;)
Navigation:
[Reply to this message]
|