Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- url: "createchild.php",
- type: 'POST',
- data: ({ATU:ATUv,AM:AMv,ATS:ATSv,segment:segmentv,acrcat:acrcatv,owner:childowner,topparent:childtp}),
- success: function(msg) {
- console.log(msg);
- }
- <?php
- header('Content-type: text/plain; charset=utf-8');
- $servername = "xxxxxxxxxxxxx";
- $username = "xxxxxxxxxxxxxxxxxxxx";
- $password = "xxxxxxxxxxxxxxx";
- $dbname = "xxxxxxxxxxxxx";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql ="INSERT INTO tablename (top_parent, qualified,retry,partner_attached,partner_name,migration,sap,AM,ATS,ATU,owner,engagement,segment,acr_cat,childtp)
- VALUES ('" . $_POST['childname'] . "','No','Unknown','No','Unknown','Not Qualified','Not Qualified','" . $_POST['AM'] . "','" . $_POST['ATS'] . "','" . $_POST['ATU'] . "','" . $_POST['owner'] . "','No','" . $_POST['segment'] . "','" . $_POST['acrcat'] . "','" . $_POST['topparent'] . "'); ";
- if ($conn->multi_query($sql) === TRUE) {
- echo "New record created successfully";
- echo "".$_POST['$childname']."";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- echo "".$_POST['$childname']."";
- }
- $conn->close();
- ?>
Add Comment
Please, Sign In to add comment