Select distinct and ajax?

Source: Internet
Author: User
First attach my program example {code ...} del {code ...} the above is my program... however, I cannot operate it. so I want to see if this method is correct? If you confirm that the id and the table name are correct, please attach your program first.

Division$ (". Box "). click (function (e) {var removetype = e. currentTarget. dataset. removetype;/* mailbox */if (removetype = 'SELECT _ del ') {$. ajax ({type: "POST", url: "del? To = "+ removetype, data: $ (" # selectid "). serialize (), cache: false, success: function (){}});}});

Del

$ User = $ _ GET ['to']; if ($ user = 'SELECT _ del ') {$ getid = $ _ POST ['id']; foreach ($ getid as $ value) {$ DEL = mysql_query ("delete from 'item table name comment 'where' ID' = '". $ value. "'");}}

The above is my program...
However, there is no way to operate
So I want to see if this method is correct?
Whether the id and the data table name are correct

Reply content:

First, attach my program example

Division$ (". Box "). click (function (e) {var removetype = e. currentTarget. dataset. removetype;/* mailbox */if (removetype = 'SELECT _ del ') {$. ajax ({type: "POST", url: "del? To = "+ removetype, data: $ (" # selectid "). serialize (), cache: false, success: function (){}});}});

Del

$ User = $ _ GET ['to']; if ($ user = 'SELECT _ del ') {$ getid = $ _ POST ['id']; foreach ($ getid as $ value) {$ DEL = mysql_query ("delete from 'item table name comment 'where' ID' = '". $ value. "'");}}

The above is my program...
However, there is no way to operate
So I want to see if this method is correct?
Whether the id and the data table name are correct

data:$("#selectid").serialize()

You can try to replace

data:$("#selectid").find('input').serialize()

If not, I think you need to check whether the script is written in compliance with the specifications. for example:
selected " >RETURN

You write this


  "> } ?>

I don't think it works ....

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.