Uncaught PDOException: Syntax error or access violation: You have an error in your SQL syntax

Advertisements I’m struggling trying to query a database inside of a PHP class. I’m getting an error when trying to echo out the email address. I’m new to classes and can’t seem to get this to work but if I do a normal PHP function, it works fine. // using composer autoload.php $user = new… Read More Uncaught PDOException: Syntax error or access violation: You have an error in your SQL syntax

Java, JDBC INSERT ON DUPLICATE KEY UPDATE wild cards

Advertisements I Have a next SQL Query: const val INSERT_OR_UPDATE_ITEM_SQL = "" + "INSERT INTO `items` (owner_id, object_id, item_id, count, enchant_level, item_location, item_location_data, custom_type1, custom_type2, duration_left, create_time)" + "VALUES (?,?,?,?,?,?,?,?,?,?,?) " + "ON DUPLICATE KEY UPDATE owner_id=?,object_id=?,item_id=?,count=?,enchant_level=?,item_location=?,item_location_data=?,custom_type1=?,custom_type2=?,duration_left=?,create_time=?" And this is preparation of PreparedStatement: statement.setString(1, item.ownerId) statement.setInt(2, item.objectId) statement.setInt(3, item.template.id) statement.setInt(4, item.count) statement.setInt(5, item.enchantLevel) statement.setString(6, item.itemLocation.name)… Read More Java, JDBC INSERT ON DUPLICATE KEY UPDATE wild cards

spring boot application is running but its docker image cant connect to maria DB which is installed localy

Advertisements I have created a docker image for my spring boot application but i am not able to get that to run. Kindly help me figure this out java.sql.SQLNonTransientConnectionException: Socket fail to connect to host:address=(host=localhost)(port=3306)(type=primary). Connection refused . . 2023-04-25T13:04:41.969Z WARN 1 — [ main] o.h.e.j.e.i.JdbcEnvironmentInitiator : HHH000342: Could not obtain connection to query metadata… Read More spring boot application is running but its docker image cant connect to maria DB which is installed localy