Skip to content
Advertisement

Database (1064) SQLSTATE[42000]: Syntax error | Importing using phpmydirectory

So, we use a script called “phpmydirectory”, and at this point it’s pretty outdated. It wasn’t designed to work on PHP 7+ or MySQL 5.7+ but we’re mostly making it work.

Part of the script, you can import new “listings (like articles on a blog)” from a .csv file. We recently updated our database server from Ubuntu 18.04 to 20.04 and MySQL also updated to 8 from 5.7 (we have some strict mode settings turned off for date_time format etc).

I am seeing this error when importing and I’m not sure why:

Here is the trace:

I’m really not sure here. Apologies.

Advertisement

Answer

Based on the keyword and reserved words information since version 8.0.2, ROW is now a reserved word:

enter image description here

So simply add quotes (or backticks) around that alias should help, such as: 'ROW'. There, and anywhere else the same may be needed.

enter image description here

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement