About the edit.php in PHP100 video tutorials

Source: Internet
Author: User
Tags echo display
The code of the video tutorial is as follows, the function is to click Edit to select the database id= "currently select the ID of the comment and then edit its contents", the database ID is set auto_increment, the video tutorial can easily get an array of current comments, I do not get. In $sql= "select * from ' feedback ' where ' id ' = '". $_get[' id ']. "'"; Front plus echo Display as SELECT * from ' feedback ' where ' id ' = ' Why can't I get the ID of the current item or the wrong side of the code, and beg you to help!


Reply to discussion (solution)

Do you have this query string on your URL? id=?

$sql = "SELECT * from ' feedback ' where ' id ' =". $_get[' id '];

ID queries do not require single quotation marks.

if (!empty ($_get[' id ')) {
//
}
When $_get[' ID '] is not equal to NULL, it will continue to execute,
Unless your $_get[' ID ' is a null value, Var_dump ($_get[' id ')) look.

Thank you for the first floor. The reason is that the ID is empty after adding href= "edit.php?id=" to the URL, the array is finally successfully obtained. 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.