Edit. php in the PHP100 video tutorial

Source: Internet
Author: User
Edit in the PHP100 video tutorial. the php video tutorial code is as follows: click to edit and select id = "id of the current selected comment and then edit its content". in the database, the ID is set to auto_increment, in the video tutorial, the array of current comments can be obtained easily, but I cannot. In $ SQL = "select * from 'feedback' where 'id' = '". $ _ GET ['id']. "'"; the echo is displayed as select * from 'feedback' where 'id' = ''. Why can't I get the id of the current item or which code is wrong? please help me!


Reply to discussion (solution)

On your url? Id = this query string?

$ SQL = "select * from 'feedback' where 'id' =". $ _ GET ['id'];

No single quotation marks are required for ID query.

If (! Empty ($ _ GET ['id']) {
//
}
When $ _ GET ['id'] is not equal to null, the execution will continue,
Unless your $ _ GET ['id'] is null, var_dump ($ _ GET ['id.

Thanks to the third floor on the first floor, the reason is that the ID is null and href = "edit. php? is added to the URL? Id = "And finally the array is obtained successfully. Thanks again!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.