Personal PHP MySQL database encountered some problems

Source: Internet
Author: User
Tags php mysql
This article introduces the content of the personal PHP MySQL database encountered some problems, has a certain reference value, now share to everyone, the need for friends can refer to

1, about a page two form submit data to a database

You only need to set the Submit data button to a different class attribute or id attribute, to commit separately, to write JS; it doesn't affect the submission of the data.

2, check box information input MySQL database

Set the same class attribute for all input boxes, and then when the AJAX data is requested, enter the following code


<p class= "checkbox_p" > <input class= "checkbox subject" type= "checkbox" Name= "Subject" value= "All-family"/> <sp An class= "Checkbox_span" > General </span> <input class= "checkbox subject" type= "checkbox" Name= "Subject" value= " Language "/> <span class=" Checkbox_span "> Language </span> <input class=" checkbox subject "type=" checkbox "Name=" s Ubject "value=" math "/> <span class=" Checkbox_span "> Math </span> <input class=" checkbox subject "type=" ch Eckbox "name=" subject "value=" English "/> <span class=" Checkbox_span "> English </span></p><p class=" Checkbox_p "> <input class=" checkbox subject "type=" checkbox "Name=" Subject "value=" physical "/> <span class=" c    Heckbox_span "> Physics </span> <input class=" checkbox subject "type=" checkbox "Name=" Subject "value=" Chemical "/> <span class= "Checkbox_span" > Chemistry </span> <input class= "checkbox subject" type= "checkbox" Name= "Subject" value= "Creature"/> <span class= "cHeckbox_span "> Biology </span> <input class=" checkbox subject "type=" checkbox "Name=" Subject "value=" Geography/> <span class= "Checkbox_span" > Political history Student </span></p>//js part
v        Ar val= ';//gets all selected data $ ("input[type=checkbox]:checked"). each (function (index, Element) {Val +=$ (this). Val () + ";       Remove comma//Val +=$ (This). Val () + ', ';    Val =val.substring (0, val.length-1); }    }
Related Article

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.