i am trying to use jqGrid and i’m getting a fatal error
Fatal error: Uncaught exception ‘PDOException’ with message ‘invalid
data source name’ in C:\xampp\htdocs\psnm\grid\grid.php:8 Stack trace:0 C:\xampp\htdocs\psnm\grid\grid.php(8): PDO->__construct(‘localhost’, ‘root’, ”) #1
C:\xampp\htdocs\psnm\electionadmin.php(40):
include(‘C:\xampp\htdocs…’) #2 {main} thrown in
C:\xampp\htdocs\psnm\grid\grid.php on line 8
and line 8 of grid.php is
$conn = new PDO("localhost",root,"");
i have the server at localhost my database name is psnm, user is root and no password, can anybody please help me find out the problem…
The constructor of the PDO needs the dsn as the first parameter. Look the syntax below:
Please consult PHP manual for more information.