Re: Deleting a Record.

From: Jochen Daum (jochen.daum_at_cans.co.nz)
Date: 11/24/03


Date: Mon, 24 Nov 2003 16:13:11 +1300

Hi!

>Still nothing....
>Not even an error message...
>

Can you do:

- error_reporting(E_ALL);

$sql = "delete from ....."
print $sql;

$result = mysql_query("DELETE FROM inventorydata
VALUES('$ProductID')");

var_dump($result);
var_dump(mysql_error());
var_dump(mysql_rows_affected());

HTH, Jochen

>Thanks,
>Rob
>"Jochen Daum" <jochen.daum@cans.co.nz> wrote in message
>news:86q2sv8ld0302f1rq9tj59ivsuf20po5m7@4ax.com...
>> Hi Rob!
>>
>> On Sun, 23 Nov 2003 19:06:41 -0700, "Rob" <talon2lm@yahoo.com> wrote:
>>
>> >Thanks for the Help on the other problems...all resolved.
>> >One last (hopefullly) problem I can't seem to get around for this
>> >program...why isn't this deleting the row i want? It does nothing. Now
>error
>> >messages either. HELP!
>> >
>> >$link = mysql_connect("localhost");
>> >if(! $link)
>> > die("Could not connect to MySQL");
>> >
>> >$database = "PC_Store";
>> >mysql_select_db($database)
>> > or die ("could not open $database: ".mysql_error() );
>> >
>> >$result = mysql_query("DELETE FROM inventorydata VALUES('$ProductID')");
>> >
>> >The $ProductID variable is brought in from a menu choice on a diffrent
>page,
>> >it is also the primary of the table...so it should delete the whole row
>> >right?
>>
>> Try
>>
>> "delete from inventorydata where field = '".$ProductID."'"
>>
>> Have a look at www.mysql.com for sql syntax
>>
>> HTH, Jochen
>> --
>> Jochen Daum - CANS Ltd.
>> PHP DB Edit Toolkit -- PHP scripts for building
>> database editing interfaces.
>> http://sourceforge.net/projects/phpdbedittk/
>

-- 
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/


Relevant Pages