Skip to content

Tag: mysql

Backslash in json_encode (PHP) + JSON_ARRAYAGG (mySQL)

The problem is the backslashes with the quotes in the array colors. I think it’s because the JSON_ARRAYAGG but I don’t know how to print a correct json. Query: PHP: OUTPUT: Answer You are encoding colors twice. First in SQL and then in PHP. What you can do is either decode colors in PHP before you…

Can’t connect to MySQL with PDO

I’m following this tutorial, I’m currently around minute 04:00 and I want to make a connection with my MySQL database through PDO. But my webpage will always give “Could not connect.” when I’m trying …