update m_tbl_invoicedetails set intPaymentId=33 where intInvoiceId=9
if i use this query means i will get error No 1242 subquery returns more then one row… i have use navigate as a mysql client
please any one tell me solution
update m_tbl_invoicedetails set intPaymentId=33 where intInvoiceId=9
if i use this query means i will get error No 1242 subquery returns more then one row… i have use navigate as a mysql client
please any one tell me solution
this can only be possible if m_tbl_invoicedetails is a view
could you please do a SHOW CREATE TABLE for that table
some fields are updated correctly
CREATE TABLE m_tbl_invoicedetails
(
intInvoiceId
int(10) NOT NULL AUTO_INCREMENT,
dtInvoiceDate
date DEFAULT NULL,
strNetCharge
decimal(10,2) DEFAULT ‘0.00’,
strComments
varchar(100) DEFAULT NULL,
intCustomerId
int(10) DEFAULT NULL,
intInvoiceNumber
varchar(10) DEFAULT NULL,
intPaymentId
int(10) DEFAULT NULL,
PRIMARY KEY (intInvoiceId
),
KEY FK_intPaymentId
(intPaymentId
),
CONSTRAINT FK_intPaymentId
FOREIGN KEY (intPaymentId
) REFERENCES m_tbl_paymentdetails
(intPaymentId
) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=94 DEFAULT CHARSET=latin1
CREATE TABLE m_tbl_invoicedetails
(
intInvoiceId
int(10) NOT NULL AUTO_INCREMENT,
dtInvoiceDate
date DEFAULT NULL,
strNetCharge
decimal(10,2) DEFAULT ‘0.00’,
strComments
varchar(100) DEFAULT NULL,
intCustomerId
int(10) DEFAULT NULL,
intInvoiceNumber
varchar(10) DEFAULT NULL,
intPaymentId
int(10) DEFAULT NULL,
PRIMARY KEY (intInvoiceId
),
KEY FK_intPaymentId
(intPaymentId
),
CONSTRAINT FK_intPaymentId
FOREIGN KEY (intPaymentId
) REFERENCES m_tbl_paymentdetails
(intPaymentId
) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=94 DEFAULT CHARSET=latin1
your query is fine, you must be getting that multiple row error message from some other query
i am getting error on this query only
once i have insert payment and get last id and insert in to my invoice table
show your PHP code, perhaps youve an error there
Is that the only query bening run by the script concerned or are there other queries run?