Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database error 1064 in PO_SelectOSPurchOrder.php
10-05-2022, 09:34 AM,
#1
Database error 1064 in PO_SelectOSPurchOrder.php
Database error 1064 in PO_SelectOSPurchOrder.php
The SQL did not produce any requests because you have an error in your SQL syntax; see the manual that corresponds to your MySQL server version for the correct syntax to use around 'ASC, purchorders.realorderno, providers.suppname, purchorde' on line 25

I am running webERP 4.15.2, MySQL Server 8.0.30 Ubuntu 20.04.2
Any ideas on what could be causing this?

Thanks in advance.

Marco
Reply
10-05-2022, 12:03 PM, (This post was last modified: 10-05-2022, 12:21 PM by TurboPT.)
#2
RE: Database error 1064 in PO_SelectOSPurchOrder.php
It looks like MySQL 8 has changed GROUP BY syntax to no longer have ASC/DESC qualifiers:

Quote:The deprecated ASC or DESC qualifiers for GROUP BY clauses are removed. Queries that previously relied on GROUP BY sorting may produce results that differ from previous MySQL versions. To produce a given sort order, provide an ORDER BY clause.

That information was as a bullet item found in MySQL's features removed in MySQL 8 list.

Try the script below to see if it helps the issue. After a quick search, it looks like this may be the only file with that syntax.


Attached Files
.php   PO_SelectOSPurchOrder.php (Size: 27.27 KB / Downloads: 5)
Reply
10-05-2022, 12:24 PM,
#3
RE: Database error 1064 in PO_SelectOSPurchOrder.php
(10-05-2022, 12:03 PM)TurboPT Wrote: It looks like MySQL 8 has changed GROUP BY syntax to no longer have ASC/DESC qualifiers:

Quote:The deprecated ASC or DESC qualifiers for GROUP BY clauses are removed. Queries that previously relied on GROUP BY sorting may produce results that differ from previous MySQL versions. To produce a given sort order, provide an ORDER BY clause.

That information was as a bullet item found in MySQL's features removed in MySQL 8 list.

Try the script below to see if it helps the issue.

It worked

Now I have the problem that I can't print the purchase order in PO_PDFPurchOrder.php, I get the HTTP error 500.

Any ideas on what could be causing this?

Thanks in advance.

Marco
Reply
10-05-2022, 12:41 PM, (This post was last modified: 10-05-2022, 01:31 PM by TurboPT.)
#4
RE: Database error 1064 in PO_SelectOSPurchOrder.php
Not sure, since the HTTP 500 is a general error.

Can you check the webserver error log to see what may have been the cause?
Look for PHP Fatal error or other errors.

I have committed the script change to GitHub, followed by a second commit to correct whitespace with the first commit.
Reply
10-06-2022, 01:21 AM,
#5
RE: Database error 1064 in PO_SelectOSPurchOrder.php
I can print purchase orders fine on my system here.
As Paul says you need to check your logs as a beginning and come back to us with whatever it says.

Tim
Reply
10-16-2022, 02:17 AM,
#6
RE: Database error 1064 in PO_SelectOSPurchOrder.php
at address /var/apache2/ in error.log file I get errorĀ 

[Sat Oct 15 10:11:18.705762 2022] [php7:error] [pid 101685] [client 190.104.121.195:2767] PHP Fatal error: Uncaught Error: Call to undefined function simplexml_load_file() in /var/www/html/webERP/PO_PDFPurchOrder.php:196\nStack trace:\n#0 {main}\n thrown in /var/www/html/webERP/PO_PDFPurchOrder. php on line 196, referer: http://44.207.52.199/webERP/PO_PDFPurchO...?OrderNo=1

waiting for your news, thanks in advance
Reply
10-16-2022, 03:28 AM, (This post was last modified: 10-16-2022, 03:30 AM by TurboPT.)
#7
RE: Database error 1064 in PO_SelectOSPurchOrder.php
What PHP version do you have?

Run:
Code:
php -m
... to check if xml is in the output. (an alphabetically sorted list)

If not, then run:
Code:
sudo apt-get install php-xml
...or equivalent installer command for whatever system that you haveĀ to get the extension added.
Reply
10-16-2022, 04:41 AM,
#8
RE: Database error 1064 in PO_SelectOSPurchOrder.php
My version of php 7.4.3
run command php -m and there was no xml in the output.
run command sudo apt-get install php-xml
again run command php -m and now xml appears in the output.

I try to print the purchase order and again I get an error, the error that the log shows me is the following:

[Sat Oct 15 12:35:57.993542 2022] [php7:error] [pid 101487] [client 190.104.121.195:35513] PHP Fatal error: Uncaught Error: Call to undefined function simplexml_load_file() in /var/www/html/ webERP/PO_PDFPurchOrder.php:196\nStack trace:\n#0 {main}\n thrown in /var/www/html/webERP/PO_PDFPurchOrder.php on line 196, referer: http://44.207.52.199/webERP/ PO_PDFPurchOrder.php?OrderNo=1


waiting for your news, thanks in advance

Marco
Reply
10-16-2022, 05:20 AM, (This post was last modified: 10-16-2022, 05:26 AM by TurboPT.)
#9
RE: Database error 1064 in PO_SelectOSPurchOrder.php
I forgot about another xml...

Back to the php -m list, is SimpleXML in the output?

I also forgot to mention previously to restart the webserver after the install.
Reply
10-16-2022, 05:55 AM,
#10
RE: Database error 1064 in PO_SelectOSPurchOrder.php
Now it works. Thank you so much.

Marco.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)