Re: Limiting the insert operation
| From: | Michael Hall | Date: | Fri, 29 Sep 2000 09:07:31 +0000 |
| Subject: | Re: Limiting the insert operation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-18023@lists.php.net to get a copy of this message | ||
One way to do it would be to check if a similar entry already exists in the
database before writing another one.
eg:
$result = mysql_query("SELECT field, field FROM table WHERE
field='$new_input'");
if ($row=mysql_fetch_row($result) >= 1) { error- data already exists }
else { go ahead and add data with INSERT statement }
Hope that's clear enough.
Michael Hall
----- Original Message -----
From: manohar sadhasivam <sadhasivammanohar@hotmail.com>
To: <php-general@lists.php.net>
Sent: Friday, September 29, 2000 11:31 PM
Subject: [PHP] Limiting the insert operation
> Hi all,
> I am executing an insert operation into Mysql thro' a form. How can i
> control the operation such that the insert is executed only once?(If the
> user clicks the submit many times, multiple inserts should not occur).
> Please help.
> cheers,
>
> mano
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>