You are here: Re: Prevent duplicate record entry « PHP Programming Language « IT news, forums, messages
Re: Prevent duplicate record entry

Posted by Steve on 12/21/07 04:49

<teser3@hotmail.com> wrote in message
news:37529850-5b2a-4f25-90e7-8db269679baa@i3g2000hsf.googlegroups.com...
>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.

gee, you could just delete any record that may exist for that first/last
name and email address. or, you could query the table to see if the record
existed. this is not only such an RTFM question, it's also a brainless one.

and let me guess, you're the kind who's code is littered with meaningful
variables like $tmp...right?!!!

 

Navigation:

[Reply to this 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

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