android - Undefined variable in php script -


seriously , have no idea what's wrong php script. i'm want update data android mysql through php script. all column value can updated except timein. can't figure out what's wrong in code.

enter image description here

updatedetails.php

<?php      if($_server['request_method']=='post'){         //getting values    $id =$_post['id'];   $project =$_post['project'];   $description =$_post['description'];   $progress =$_post['percentage'];   $timein =$_post['timein'];   $timeout = $_post['timeout'];      require_once('dbconnect.php');   $sql = "update work_details set  project = '$project', work_description = '$description', percentage = '$progress', timein = '$timein' , timeout ='$timeout' id = $id;";    //updating database table   if(mysqli_query($con,$sql)){  echo ' updated successfully';  }else{  echo 'could not update. try again';  }  //closing connection   mysqli_close($con);     }   ?> 

updatedetails function

public void update( final string project, final string description, final int progress, final string timein, final string timeout) {     class updateinfo extends asynctask<void,void,string>{         progressdialog loading;         @override         protected void onpreexecute() {             super.onpreexecute();             loading = progressdialog.show(edit_details.this,"updating...","wait...",false,false);         }          @override         protected void onpostexecute(string s) {             super.onpostexecute(s);             loading.dismiss();             toast.maketext(edit_details.this,s,toast.length_long).show();         }          @override         protected string doinbackground(void... params) {             hashmap<string,string> hashmap = new hashmap<>();             hashmap.put(config.key_id,id);             hashmap.put(config.key_project,project);             hashmap.put(config.key_description,description);             hashmap.put(config.key_progress,string.valueof(progress));             hashmap.put(config.key_time_in,timein);             hashmap.put(config.key_time_out,timeout);             requesthandler rh = new requesthandler();             string s = rh.sendpostrequest(config.url_updatedetails,hashmap);              return s;         }     }      updateinfo ue = new updateinfo();     ue.execute(); } 

config

  public static final string key_time_in="timein"; 

your sql statements has

"... timein = '$timein' ..." 

but declare variable before

$timein =$_post['timein'];  

make sure fix upper/lower case variables match.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -