Android post values to MySQL with PHP -
this question has answer here:
- php parse/syntax errors; , how solve them? 11 answers
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.
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
Post a Comment