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!