I have retrived a set of numbers from a device, I divided it into two parts and compared if that exist in a table. When i gave a random array it worked properly. Below I give the code.
<?php
$array=$_POST['tel']; //numbers fetched from contact of mobile
$jstring = (array)json_decode($array,JSON_FORCE_OBJECT);
$ttutt =implode("','", $jstring);
$tet = explode(',', $ttutt);
foreach( $tet as $value ) //loop over values
{
$four = mb_substr($value, 0,-10); //to get the first chara's
$ten = mb_substr($value, -10); // to get the last ten chara
$corn=mysqli_connect("localhost","bukado","********","frocd"); //connection to the database
$result = mysqli_query($corn, "SELECT * From prip WHERE nob IN ($ten) AND cdac IN ($four)");
while($row = mysqli_fetch_array($result, MYSQL_ASSOC))
{
$forl[] = $row[no];
}
mysqli_close($corn);
}
?>
Can any body please help me? any help will be appreciable. Regards. Thanks in advance.