Home  >  Q&A  >  body text

There is no output result and no error message.

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? 配置文件.png插入数据文件.png表结构.png

XX2359 days ago1773

reply all(5)I'll reply

  • lcy

    lcy2020-04-20 00:49:31

    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}";

    reply
    0
  • 怪我咯

    怪我咯2019-12-03 23:52:16

    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.

    reply
    1
  • 外星人

    外星人2018-12-18 20:53:38

    mine too

    reply
    0
  • 青风百里

    青风百里2018-05-28 12:32:55

    Check the table structure of your database

    屏幕快照 2018-05-28 12.32.03.jpeg

    reply
    0
  • 外星人

    Or not

    外星人 · 2018-12-18 21:23:56
  • Cancelreply