Re: Delete a record

From: Date: Sat, 14 Sep 2002 00:37:37 +0000
Subject: Re: Delete a record
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-116337@lists.php.net to get a copy of this message
Michael Sims wrote:
On Fri, 13 Sep 2002 19:44:52 -0400, you wrote:
$query = "DELETE * FROM logiciellg WHERE LOGICIEL_ID=$ID"; // If you want to delete the entire row $query = "DELETE cell_name FROM logiciellg WHERE LOGICIEL_ID=$ID"; // If you want to delete just one part of the row
Which RDBMS are you using that allows you to delete specific FIELDS from a row? How would such a thing even be possible?
I think the original poster just made an error. Both of those examples violate SQL, so I can't imagine a database that supports them. Now, if they were very useful violations (like Rasmus's LIMIT clause), then it would be more likely to see support. :-) Any alteration to an existing record, short of deleting the entire record, should use UPDATE. Depending on what you would consider "deleted", an UPDATE statement can "delete" fields from a row. For many people, an empty string is going to be just as good, so you can do something like this: update table set field='' where row_id='$row_id' Happy hacking. Chris

« previous php.general (#116337) next »