RE: [PHP] A MySQL question
| From: | Giz | Date: | Mon, 14 Jul 2003 23:26:01 +0000 |
| Subject: | RE: [PHP] A MySQL question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155199@lists.php.net to get a copy of this message | ||
You have made a mistake in your database design. Every table should have a
primary key that allows you to uniquely identify any single row in the
table. You do not have a primary key, hence when you want to delete a
single row from a series of duplicates, you can't do it. Unlike oracle,
mysql has no rowid.
-----Original Message-----
From: zavaboy [mailto:zavaboy@hotmail.com]
Sent: Monday, July 14, 2003 2:13 PM
To: php-general@lists.php.net
Subject: [PHP] A MySQL question
Ok, I want to delete only 1 row off of a database table...
Example:
I have a table with columns "user" and "item"...
Lets say the table contains the following rows (user | item):
582-668243 | Toothbrush
582-668243 | Toothbrush
582-668243 | Toothbrush
582-668243 | Trash can
582-668243 | Trash can
582-668243 | Something else
582-668243 | Something else
582-668243 | Something else
582-668243 | Something else
720-387690 | Dog treats
720-387690 | Car
720-387690 | Car
720-387690 | Toothbrush
720-387690 | Toothbrush
Ok, user 582-668243 is buying a lot, eh? LoL
Anyway, how can I remove only 1 Toothbrush from user 582-668243?
I just want the query... I've been trying to find it out for a few hours
now...
Thanks in advance!
--
- Zavaboy
zavaboy@hotmail.com
www.zavaboy.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php