I am having a problem returning a JSON array after trying to do a query where I want the query to return the first name, last name , and email after giving it numerous ids. How would I go about returning an array with rows including the above parameters after giving it ids. here is what I have
This works :
$qry = "SELECT ALL $mysql_database.$patientsTable.Users_idUser FROM $mysql_database.$patientsTable WHERE doctorsTable_id_doctorsTable=$qr";
$res = mysql_query($qry,$connect) or die(mysql_error());
then this is what I am working on where it is not working :
$arr_length = count($arr);
for($i=1;$i<=$arr_length;$i++)
{
$integerIDs = json_decode('[' .json_encode($arr[$i]['Users_idUser']) . ']', true);
$q = "SELECT firstName,lastName,email from $mysql_database.$UsersTable WHERE idUser='$integerIDs[$i]'";
$res1 = mysql_query($q,$connect) or die(mysql_error());
}
I want to for loop to return the above question but i am having problem with this.