Re: adding a new record
| From: | gcclimacosa at imgame dot net | Date: | Mon, 05 May 2003 08:50:36 +0000 |
| Subject: | Re: adding a new record | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27530@lists.php.net to get a copy of this message | ||
make your column unique
[like for example;
ALTER TABLE
table_name ADD sample_column VARCHAR( 10 ) NOT NULL ;
ALTER TABLE table_name ADD UNIQUE (sample_column);
]
so every time you insert and even if its the same data.. it won't insert
into your table unless it is unique...
> is there some way to construct an INSERT query such that it only adds the
> record if certain values don't already exist in the table? (not unlike
> SELECT DISTINCT). or do i have to make a seperate SELECT statement to
> check
> before adding?
>
> thanks,
> -jake
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>