DW's simple PHP management

Source: Internet
Author: User
DW makes simple PHP management on this page, there are two action buttons, one is "modify" and the other is "delete ".

Click "modify", as shown in:

After clicking "delete", there is no data record on the page after the jump. In fact, you cannot see it on the page.
Normally, you are redirected to the official deletion page and click the delete button under the corresponding record to complete the deletion?

Where is the problem?


Reply to discussion (solution)

What is the deleted query statement?

If (isset ($ _ GET ['id']) & ($ _ GET ['id']! = "")){
$ DeleteSQL = sprintf ("delete from price WHERE id = % s ",
GetSQLValueString ($ _ GET ['id'], "text "));

Mysql_select_db ($ database_myconn, $ myconn );
$ Result1 = mysql_query ($ deleteSQL, $ myconn) or die (mysql_error ());
}

$ Colname_Recordset1 = "1 ";
If (isset ($ _ GET ['id']) {
$ Colname_Recordset1 = (get_magic_quotes_gpc ())? $ _ GET ['id']: addslashes ($ _ GET ['id']);
}
Mysql_select_db ($ database_myconn, $ myconn );
$ Query_Recordset1 = sprintf ("SELECT * FROM price WHERE id = % s", $ colname_Recordset1 );
$ Recordset1 = mysql_query ($ query_Recordset1, $ myconn) or die (mysql_error ());
$ Row_Recordset1 = mysql_fetch_assoc ($ Recordset1 );
$ TotalRows_Recordset1 = mysql_num_rows ($ Recordset1 );

If (isset ($ _ GTE ['id']) {
$ Query_Recordset1 = sprintf ("SELECT * FROM price WHERE id = % s", $ colname_Recordset1 );
} Else {
$ Query_Recordset1 = "SELECT * FROM price WHERE 1 = 1 ";
}

If (isset ($ _ GTE ['id']) {
$ Query_Recordset1 = sprintf ("SELECT * FROM price WHERE id = % s", $ colname_Recordset1 );
} Else {
$ Query_Recordset1 = "SELECT * FROM price WHERE 1 = 1 ";
}


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The younger brother still does not understand it.

It is estimated that you have directly executed the delete code.

It is estimated that you have directly executed the delete code.

QQ

Edit page:
Delete

Delete page:
If ($ _ POST ){
Yes, form submission. execute deletion.
} Else {
You can use $ _ GET ['id'] to obtain the records to be deleted and generate a deletion page.
}

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.