It seems that I encountered the same problem as above? Tested in PHPstudy, the information is as follows. I checked phpinfo and found that pdo is enabled. What problem did this encounter?
Let me answer, the solution is simple! ! ! ! ! I was also troubled for more than half an hour, and I was so irritated that I finally found the problem!
First of all, let me state the problem: the webpage did not report an error after running! There is nothing, it is blank.
The reason is the capitalization problem of letters! There's really no way around this, it's such a huge pitfall! !
The N in the dbName in the code cannot be capitalized, it must be Lowercase! ! ! The correct code is as follows! ! Hey, this mistake is more annoying than a punctuation mark! ! I hope this problem can be avoided in the future!
After correction: $dsn="{$dbType}:host={$host};dbname={$dbName}";
Same for me, var_dump($num); The result is boolean false You can insert it by executing the sql statement directly in the database. php.ini expands normally.
Let me answer, the solution is simple! ! ! ! ! I was also troubled for more than half an hour, and I was so irritated that I finally found the problem!
First of all, let me state the problem: the webpage did not report an error after running! There is nothing, it is blank.
The reason is the capitalization problem of letters! There's really no way around this, it's such a huge pitfall! !
So here is the solution below!
Source code: $dsn="{$dbType}:host={$host};dbName={$dbName}";
The N in the dbName in the code cannot be capitalized, it must be Lowercase! ! ! The correct code is as follows! ! Hey, this mistake is more annoying than a punctuation mark! ! I hope this problem can be avoided in the future!
After correction: $dsn="{$dbType}:host={$host};dbname={$dbName}";
Same for me, var_dump($num); The result is boolean false
You can insert it by executing the sql statement directly in the database. php.ini expands normally.
mine too
Check the table structure of your database