Re: A MySQL question
| From: | zavaboy | Date: | Mon, 14 Jul 2003 22:53:13 +0000 |
| Subject: | Re: A MySQL question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155196@lists.php.net to get a copy of this message | ||
Ok, I added a primary key. I figured it out and I have it working... Thanks!
"Chris Shiflett" <shiflett@php.net> wrote in message
news:20030714212006.75107.qmail@web14308.mail.yahoo.com...
> --- zavaboy <zavaboy@hotmail.com> wrote:
> > Lets say the table contains the following rows (user | item):
> > 582-668243 | Toothbrush
> > 582-668243 | Toothbrush
> > 582-668243 | Toothbrush
> ...
> > Anyway, how can I remove only 1 Toothbrush from user 582-668243?
>
> With the information you provided, you can't. You should never have
multiple
> rows in the database that are non-unique, and this is one reason why. You
need
> a primary key.
>
> > I just want the query
>
> You should rather spend your time learning some database fundamentals
rather
> than asking this list (not a database list, in fact) for spoon-fed
answers. You
> will appreciate the knowledge more than the answer.
>
> Chris
>
> =====
> Become a better Web developer with the HTTP Developer's Handbook
> http://httphandbook.org/