[PHP-DB] How to delete specific row in mysql table?

2001-08-28 Thread Jan Grafström

Hi!
I am new to this an wonder how to delete a row in my table.

I have tryed with:
--
DELETE FROM mytable WHERE 32
-
to delete row number 3 but all rows goes away!

Thanks in advance for any help.
Regards
Jan



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] How to delete specific row in mysql table?

2001-08-28 Thread Rick Emery

Your statement is saying:  if 3 is greater than 2, delete all

Your WHERE criteria should be based upon a specific field's contents, NOT
its position in a data base

-Original Message-
From: Jan Grafström [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 11:51 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] How to delete specific row in mysql table?


Hi!
I am new to this an wonder how to delete a row in my table.

I have tryed with:
--
DELETE FROM mytable WHERE 32
-
to delete row number 3 but all rows goes away!

Thanks in advance for any help.
Regards
Jan



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] How to delete specific row in mysql table?

2001-08-28 Thread Jason Brooke

 Hi!
 I am new to this an wonder how to delete a row in my table.

 I have tryed with:
 --
 DELETE FROM mytable WHERE 32
 -
 to delete row number 3 but all rows goes away!

 Thanks in advance for any help.
 Regards
 Jan


That's because the number 3 is greater than the number 2, so is always true,
and does nothing to identify the row you want to delete

You need to find something unique to identify row number 3 with, then modify
your WHERE clause to idenfity the row using that unique column, such as

'delete from mytable where rowid = 3'

This is an SQL question really - you should probably consult an SQL
reference

jason


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]