Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SQL error in ReverseGRN.php
09-20-2016, 11:55 AM
Post: #1
SQL error in ReverseGRN.php
Hi all:

In version 4.13, when the description of the item includes a ' it is not properly formatted and caused the SQL to fail.

Database Error 1064 : CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE: The purchase GL posting could not be inserted for the reversal of the received item because
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's green cat eye&light green 95cm x 12 @ 589,087', '-7069044')' at line 14
Database SQL Failure : The following SQL to insert the purchase GLTrans record was used
INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) VALUES ( 25, '21374', '2016-09-20', '90', '111517000', 'GRN Reversal for PO: 2216 GLITTR - CENE12-King's green cat eye&light green 95cm x 12 @ 589,087', '-7069044')
Database Rollback Due to Error Above : Rolling Back Transaction OK

Regards,
Pak Ricard
Find all posts by this user
Quote this message in a reply
09-20-2016, 05:45 PM
Post: #2
RE: SQL error in ReverseGRN.php
Hi Ricard, it should be

DB_escape_string($GRN['itemdescription']) not $GRN['itemdescription'] in the SQL. Remember to change it on both lots of SQL.

Thanks
Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
10-17-2016, 05:35 AM
Post: #3
RE: SQL error in ReverseGRN.php
(09-20-2016 05:45 PM)falkoner Wrote:  Hi Ricard, it should be

DB_escape_string($GRN['itemdescription']) not $GRN['itemdescription'] in the SQL. Remember to change it on both lots of SQL.

Thanks
Tim

The GRN record could not be deleted because
Cannot delete or update a parent row: a foreign key constraint fails

when i Enter Supplier Credit Note and then Reverse Goods Received and then try to reverse but show these line why?
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)