Re: Delete a record
| From: | Matt | Date: | Fri, 13 Sep 2002 22:15:14 +0000 |
| Subject: | Re: Delete a record | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116323@lists.php.net to get a copy of this message | ||
From: "Christian Ista" <Christian.ista@teledisnet.be>
To: <php-general@lists.php.net>
Sent: Friday, September 13, 2002 5:42 PM
Subject: [PHP] Delete a record
> 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 ?
You haven't posted all of your script. Do you connect and select a db
before trying the mysql_query? It would be useful to you to use
mysql_error() to get the error message from mysql instead of just echoing
out invalid query. i.e. or die (mysql_error());