I'm new to PHP and using it to interact with databases through android. Rather than having the specific query/statement in the PHP code, I'd like to just be able to save it as a variable and then forward it to the PHP server. Is this possible? With my code shown below, I get an error,
Exception Illegal character in query at index 67: phpfilelocation.php?statement=SELECT * FROM Users
<?php
$con=mysqli_connect(loginhere);
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$statement = $_POST["'statement'"];
$result = mysqli_query($con,"'$statement");
$row = mysqli_fetch_array($result);
$data = $row[0];
if($data){
echo $data;
}
mysqli_close($con);
?>