Unable to insert data.
怪我咯
怪我咯 2019-12-03 23:57:20
0
7
1533

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.


1111.png

怪我咯
怪我咯

reply all (6)
王先生

Actually, there is no problem. I just missed a field. Look at what you wrote, are there any details that you didn’t notice

    怪我咯

    What do you think is the reason? This is really strange.

      王先生

      You didn't find the root cause. I have the same problem and I didn't find the root cause either. CamelCase variable naming has no effect at all. Mine cannot be inserted normally if the $createTime parameter is added. If the content of this field is not inserted, it can be inserted normally

      • reply I only used username and password and no other fields.
        怪我咯 author 2019-12-12 10:30:20
      怪我咯

      Camel case naming is not supported. Variable names can only be in lowercase. For example, it is not possible to write $dbtype as $dbType. What is the reason?


      toufeng.png

        怪我咯

        $dsn="{$dbtype}:host={$host};dbname={$dbname}";

        Finally found the reason. There can't be any spaces in it. It doesn't work if there are spaces.

          胡胡

          PDO related information

          2222.png

            Latest Downloads
            More>
            Web Effects
            Website Source Code
            Website Materials
            Front End Template
            About us Disclaimer Sitemap
            php.cn:Public welfare online PHP training,Help PHP learners grow quickly!