RE: Feature Request: UPDATE 'error codes' or mysql_affected_rows() to be more "accurate"

2004-05-31 Thread Robert A. Rosenberg
At 12:38 -0700 on 05/27/2004, Daevid Vincent wrote about Re: Feature Request: UPDATE 'error codes' or mysql_affected: REPLACE INTO won't work, as I need the previous record (hence the update). I store the first and last time I saw a node, amongst other info. REPLACE would delete that data. REPLAC

Re: Feature Request: UPDATE 'error codes' or mysql_affected_rows() to be more "accurate"

2004-05-31 Thread Sasha Pachev
Daevid Vincent wrote: Well, my "hack" (which is sort of like what you suggest) is to change my primary key from just an auto_increment 'id' field to a combination of two other fields (mac/scanner_id) that I know must be unique. Then I rely upon the fact that mySQL will not allow a duplicate PK. (I

RE: Feature Request: UPDATE 'error codes' or mysql_affected_rows() to be more "accurate"

2004-05-27 Thread Daevid Vincent
PLACE would delete that data. http://daevid.com > -Original Message- > From: Steve Meyers [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 27, 2004 7:42 AM > To: Daevid Vincent > Cc: [EMAIL PROTECTED] > Subject: Re: Feature Request: UPDATE 'error codes' or > mysql_a

Re: Feature Request: UPDATE 'error codes' or mysql_affected_rows() to be more "accurate"

2004-05-27 Thread Steve Meyers
http://dev.mysql.com/doc/mysql/en/INSERT.html INSERT [LOW_PRIORITY | DELAYED] [IGNORE] [INTO] tbl_name [(col_name,...)] VALUES ({expr | DEFAULT},...),(...),... [ ON DUPLICATE KEY UPDATE col_name=expr, ... ] If you specify the ON DUPLICATE

Re: Feature Request: UPDATE 'error codes' or mysql_affected_rows() to be more "accurate"

2004-05-26 Thread Robert J Taylor
Does REPLACE INTO not work in your case? | | |REPLACE| works exactly like |INSERT|, except that if an old record in the table has the same value as a new record for a |PRIMARY KEY| or a |UNIQUE| index, the old record is deleted before the new record is inserted. See section 14.1.4 |INSE