Am testing the following on my browser .
test1 is working with no problem but text2 doesn't return any result nor feeback and when i check through the table no records are inserted by test2
Need help please.
test1 is working with no problem but text2 doesn't return any result nor feeback and when i check through the table no records are inserted by test2
Need help please.
B4X:
case "test":
$q = mysqli_query($con,"INSERT INTO userregister (CustomerName, CustomerNo) VALUES ('ekow', '500')");
$q = mysqli_query($con,"SELECT * FROM userregister where CustomerNo='42'");
$rows = array();
while($r = mysqli_fetch_assoc($q))
{
$rows[] = $r;
}
print json_encode($rows);
mysqli_close($con);
break;
case "test2":
$name = $_GET["name"];
$number = $_GET["number"];
$name= mysqli_real_escape_string($con, '$name');
$number = mysqli_real_escape_string($con, '$number');
$q = mysqli_query($con,"INSERT INTO userregister (CustomerName, CustomerNo) VALUES ('".$name."', '".$number."')");
$q = mysqli_query($con,"SELECT * FROM userregister where CustomerNo='".$number."'");
$rows = array();
while($r = mysqli_fetch_assoc($q))
{
$rows[] = $r;
}
print json_encode($rows);
mysqli_close($con);
break;
Last edited: