Re: Delete a record
| From: | Tom Ray | Date: | Fri, 13 Sep 2002 23:44:52 +0000 |
| Subject: | Re: Delete a record | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116327@lists.php.net to get a copy of this message | ||
You missing an element in your statement. Are you deleting on cell in that table row? Or are you deleting the whole row? It should look like
$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
$query = "DELETE cell_name AND cell_name FROM logiciellg WHERE LOGICIEL_ID=$ID"; // If you want to delete more then one part of the row.
You're current query opens the logicellg table, finds the row that matches LOGICIEL_ID but then dies because it doesn't know specifically what to delete.
Christian Ista wrote:
Hello, I'd like delete some row from a table. I do that : $query="DELETE FROM logiciellg WHERE LOGICIEL_ID=$ID"; $result = mysql_query($query) or die ("Invalid query"); when I look the query via an echo the query look ok. But when I execute (mysql_query) I receive "Invalid query". Could you tell me why ? Bye