Becaye Posted May 24, 2019 Share Posted May 24, 2019 Hi ! I've a big problem since several days. When I try to connect to my Sql database, I get a 403 error. I read somme topics but it didn't change anything. Help please !! $bdd = new PDO('mysql:host=sql###.byethost.com;dbname=dbname;charset=utf8', 'id', 'password', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); Quote Link to comment Share on other sites More sharing options...
mike Posted May 24, 2019 Share Posted May 24, 2019 9 hours ago, Becaye said: Hi ! I've a big problem since several days. When I try to connect to my Sql database, I get a 403 error. I read somme topics but it didn't change anything. Help please !! $bdd = new PDO('mysql:host=sql###.byethost.com;dbname=dbname;charset=utf8', 'id', 'password', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); Did the code work flawlessly before ? If so, did you change anything recently ? Quote Link to comment Share on other sites More sharing options...
Becaye Posted June 3, 2019 Author Share Posted June 3, 2019 On 24/05/2019 at 4:07 PM, mike said: Did the code work flawlessly before ? If so, did you change anything recently ? It works when I am in localhost but when I send it to byet server, I adapt the names but it doesn't work Quote Link to comment Share on other sites More sharing options...
mike Posted June 4, 2019 Share Posted June 4, 2019 On 6/3/2019 at 6:35 AM, Becaye said: It works when I am in localhost but when I send it to byet server, I adapt the names but it doesn't work I've just tested some php code with a pdo connection, and everything worked perfectly. Please check the username, password, server, and database names. If this everything is okay, but you still get the same error, please post a bit more of your code. Quote Link to comment Share on other sites More sharing options...
aerocirno Posted July 3, 2019 Share Posted July 3, 2019 As some advice use utf8mb4 and utf8_unicode_520_ci as your charset and collation in your queries please, the old utf8 doesn't fully support UTF-8 characters exceeding three bytes like emoji and just cuts them off which can impose a potential security hazard to my knowledge. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.