This topic is locked

PHPRunner Import screen - Update statement as record with P Key already exists - POsting again

5/8/2025 3:02:18 AM
PHPRunner General questions
R
Rupesh author

Posting this question again as some text went missing after clicking on submit button - somehow.

PHPRUNNER V 10.91 Build 41242

Import Data

Primary key already exists so phprunner fired an update statement on the DB.

Update statement contains where 1=0 in the clause. and hence data is not getting updated in the DB. This 1=0 should not come in the update where clause.

Update statement as taken from Debugging is here for your reference
UPDATE sale_invoices SET sale_date='2025-03-12', doc_type='Sale', customer_name='Wadehra & Co. P.Ltd.', sale_qty=1, sale_rev_amount=null, sale_amount=17416.00 WHERE ( 1=0 ) and ( ( invoice_no='3241371' ) )

Someone please help.

C
Chris Whitehead 5/10/2025

Without looking at the actual values/code it's a little difficult, I've never seen the 1=0 before so hard to say where it's coming from If you remove the 1=0 in the where and paste into a mysql client such as Heidi does that update?..

As a start to try and debug it, I'd manually put in the update mysql statement in the the before record updated and return false, you could also use this as a workaround till you find the solution,