0
can you tell me what's wrong in my code
if (isset($_POST['sumbit'])) { try { $conx = new PDO("mysql:host=localhost; dbname=admin","root",""); } catch (Exception $e) { echo $e -> getMessage(); exit(); } }
3 Réponses
+ 1
What problem you are dealing with? it's not possible to test such code in SoloLearn. You need to elaborate more in thread's Description in order for people to understand what the problem is, and suggest something proportionally.
+ 1
Ok, maybe you can try making new code using try...catch block. And then test it to see if it also gives warning near `try`
When I tried your code, I didn't get such warning. Although I do get a note saying driver not available when I tested the PDO initialiization.
0
The php compilator says : Parse Error near to the try. I didn't understand what is the problem ?