php - Update database phone number -


currently running program, when click submit new phone number button, ajax shows response pop empty.

i don't have running errors don't see issue.

main index.php file:

case 'updatephone' :     include('assets/header.php'); // create top box     include('assets/sidemenu.php'); // create side menu     // use template display result     include('views/displayupdatephoneform.php');     include('assets/footer.php'); // create footer     break;  case 'changephone' :     $sql = 'update members set mobilephone=:mobilephone indid=:indid';     $phone = $_post['mobilephone'];     $values = array(':indid'=>$_post['indid'], ':mobilephone'=>$phone);     $stm = $db->prepare($sql);     $result = $stm->execute($values);     echo $result;     break; 

displayupdatephoneform.php

<h4>changing mobile phone</h4> <p>enter new number: <input type='tel' id='newphone' /> <button type='button' class='btn btn-primary' id='updatephone' >change  phone</button> </p> 

script.js

$(document).ready(function(){     url = '/cs382/cookead06/final/final_app';      if ($('#uid').val() != '-1'){         $('#sign-in' ).hide();         $('#sign-out').show();     }      $('#p2').on('change', function(){         $('#form2').submit();     });     $('#p3').on('change', function(){         $('#form3').submit();     });     $('#p4').on('change', function(){         $('#form4').submit();     });       // validate user      $('#updatephone').on('click', function(){         var f_id = $('#uid').val();         var phone = $('#newphone').val();         $.ajax({               type : 'post',               url : url + '/index.php?action=changephone',               data : 'indid=' + f_id + '&mobilephone='+ phone,               success : function(response){                     alert(response);                }           });      });        $('#signinbtn').on('click', function(){         var username = $('#username').val();         var password = $('#passwd').val();         var data_items = 'username='+username + '&passwd=' + password;         $.ajax({             type : 'post',  // type: or post             url : url + '/index.php?action=checklogin',  // define server-side script             data : data_items,  // define data sent             success : function(response){                if (response != -1){                   // hide login information                   $('#username, #passwd').val('');                   $('#login-content, #sign-in').hide();                   $('#sign-out').show();                   // update value of 'uid'                   $('#uid').val(1);                   // display user's name                   $('#user-info').text(response);                   $('#update-link').removeclass('hidelink').addclass('displaylink');                 } else                   alert("invalid user");               }          });      }); }); 

enter image description here

sorry, read wrongly..

i re-read , can see printing $result = $stm->execute($values); sql query, if query executes successfully, won't show message, if implemented echo on function execute..


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -