The problem with code below is variable sp1. When replacing sp1 into "where" clause with a city name already existing in database, everything works well. But when i send startPoli1 variable from my app, php returns nothing. Logcat shows that startPoli1 is being sent every time. Any suggestion;
<?php
$con=mysql_connect("......","......","......" );
$database = "......";
$ok = mysql_select_db($database, $con);
mysql_set_charset("UTF8",$con);
$us1 = $_POST['username1'];
$sp1 = $_POST['startPoli1'];
$fp1 = $_POST['finalPoli1'];
$w1 = $_POST['weight1'];
$em1 = $_POST['eidosmetaf1'];
$dD1 = $_POST['depDate1'];
$dT1 = $_POST['depTime1'];
$sql = mysql_query( " SELECT `username1`,`startPoli1`, `finalPoli1`, `eidosmetaf1`, `weight1` , `depDate1` , `depTime1`, `tilefono1`
FROM customer ,registration1
where (customer.startPoli1 = 'sp1') and
(customer.username1 = registration1.username )");
if($sql === FALSE)
{
die(mysql_error());
}
$results = array();
while($row = mysql_fetch_assoc($sql))
{
$results[] = array(
'username1' => $row['username1'],
'startPoli1' => $row['startPoli1'],
'finalPoli1' => $row['finalPoli1'],
'eidosmetaf1' => $row['eidosmetaf1'],
'weight1' => $row['weight1'],
'depDate1' => $row['depDate1'],
'depTime1' => $row['depTime1'],
'tilefono1' => $row['tilefono1']
);
}
echo json_encode(array('select_itin_results' =>$results));
mysql_close($con);
?>