my android code sends variable to PHP file which supposed to use it in making queries on MYSQL Server.
the problem is after defining the variable, any command I write generates error.
the php code:
<?php
require "init.php";
$coresite = $_POST["selectedcoresite"]
?>
here I have no issue and the output of the file is "nothing" but working.
but if I added any thing like:
$coresite = $_POST["selectedcoresite"]
$x = "10";
?>
it return an error: Parse error: sytax error, unexpected'$x' (T_variable)
I tried with other commands like echo and print_r to the variable, still producing the same error with different variables.
is there anything missing here after receiving my data from android?
I should complete the php code with prepared statement to be like below but definitely it is producing the same error:
<?php
require "init.php";
$coresite = $_POST["selectedcoresite"]
$stmt = $mysqli -> prepare("SELECT Cabinet_Row FROM cabinets WHERE Core_Site=?");
$stmt -> bind_param("s",$coresite);
$stmt -> execute();
$stmt -> bind_result($result);
$stmt -> fetch();
?>