Android post values to MySQL with PHP -


this question has answer here:

i work on android project, in use asynctask send namevaluepairs webservice. use php code below send data application database:

<?php   require_once('dbconnect.php');    $studentid = $_post['name'];   $classid = $_post['classid']   $studentid = $_post['studentid'];   $start = $_post['start'];   $end = $_post['end'];   $startsig = $_post['startsig'];   $endsig = $_post['endsig'];    $sql = "insert signature (studentid,classid,start,end,startsig,endsig) values ('$studentid','$classid','$start','$end','$startsig','$endsig')";   if(mysqli_query($con,$sql)){     echo 'success';   }   else{     echo 'failure';   }   mysqli_close($con); ?> 

values in dbconnect.php file correct. database schema looks this. enter image description here

i checked, application sends out data successfully, when try access php file above browser http 500 error. else should check in case?

there 2 problems noticed in code didn't put semicolon after

$classid = $_post['classid'] 

and why assigning 2 different post values same phpvariable $studentid = $_post['name']; , $studentid = $_post['studentid'];.anyways $studentid have last assigned value $_post['studentid']

try debugging more errors


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -