Re: Constrain
| From: | (Richard Lynch) | Date: | Sat, 10 Jun 2000 00:09:00 +0000 |
| Subject: | Re: Constrain | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1510@lists.php.net to get a copy of this message | ||
In article <8haju9$4nl$1@cvs.php.net>, durrani@comatindia.com ("D u r r a
n i") wrote:
> I want to generate a query such that there exists two fields:
> filepath and filename
> First I will insert:
> filepath as "/durrani/drive/"
> filename as "xyz.txt"
>
> Now if I try to insert again the same filepath and filename then I want to
> generate an error message.
Depends on which database you are using and has little or nothing to do
with PHP per se...
create unique index pathname on blah(filepath, filename)
might be some good SQL for your database. Or not.
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)