I studied Ximen Daguanren's imitating iQiyi website and got stuck in the 2-3 package database access class.
hiki1987
hiki1987 2018-08-16 21:01:23
0
3
1642

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 follows3.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. .


hiki1987
hiki1987

reply all (1)
帮车-阿龙

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 where condition 'id'=1 changed to 'id'=>1
    hiki1987 author 2018-08-16 21:24:55
  • reply 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 author 2018-08-16 22:08:23
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!