search

Home  >  Q&A  >  body text

I studied Ximen Daguanren’s imitating iQiyi website and got stuck in the 2-3 package database access class.

After completing the video, print the information and prompt that the page cannot be found

1.png

The contents of the Test.php file are as follows:

2.png

The Sysdb.php file is as follows 3.png

The directory structure is as follows:

4.png

I checked the video 3-4 times and couldn’t find it. Where is the problem? It seems to be the file access location. There is no problem with the administrator page created in the previous section.

5.png

The database is also configured

6.png

Database information

7.png

phpstudy configuration information path is a bit different from the video, but the administrator can access it in the backend. The problem should not be here.

8.png

Please help me to give some advice, I don’t want to give up halfway again. .


hiki1987hiki19872294 days ago1762

reply all(3)I'll reply

  • hiki1987

    hiki19872018-08-16 21:23:51

    The screenshot of the Test.php file was posted wrongly. The problem should be 1. First open app_debug in config.php, so that it is easier to find the problem. 2. When accessing, a syntax error message is given. The where condition of 'id'=1 is changed to 'id'=>1  When accessing again, it should be normal. This should be because the database does not have data

    reply
    0
  • hiki1987

    where condition 'id'=1 changed to 'id'=>1

    hiki1987 · 2018-08-16 21:24:55
    hiki1987

    In the video, no data is inserted after the administrator table is created, and data is added in video 2-3. After inserting a piece of data, it is consistent with the system. Access tips array(1) { [0] => array(2) { ["id"] => int(1) ["username"] => string(5) "admin" } }

    hiki1987 · 2018-08-16 22:08:23
  • Cancelreply