this is my code where i have problem, here i am not getting any result for stmt2 fetch data,
$result = $user_hash_conn->query($q1);
if($result->num_rows > 0){
$stmt = $store_conn->prepare('SELECT `location`,`institute`, `category`, `sub_category`, `date`,`title`, `message` FROM `pre_demand_by_key` WHERE `key`=?');
$stmt->bind_param("s",$key);
# for no of match found
$stmt2 = $store_conn->stmt_init();
$stmt2 = $store_conn->prepare('SELECT `key` FROM `store_list` WHERE `location`=? AND `institute` LIKE ? AND `category`=? AND `sub_category` LIKE ?');
while($row = $result->fetch_assoc()){
$key = $row['varchar_128'];
$stmt->execute();
$stmt->bind_result($location,$institute,$category,$sub_category,$date,$title,$message);
while($stmt->fetch()){
#no of match found
$location2 = $location;
$institute2 = $institute."%";
$category2 = $category;
$sub_category2 = $sub_category."%";
$stmt2->bind_param("ssss",$location2,$institute2,$category2,$sub_category2);
$stmt2->execute();
$stmt2->bind_result($item_key2);
echo $stmt2->error;
$item_keys = [];
while($stmt2->fetch()){
echo $item_key2;
}
}
}
}
i have record in my table for my second stmt, but here i doesn't give my any result all my code is correctly written(mean i didn't have spelling mistake related to db or tb name), when i manually check it on phpmyadmin it responsed with some result. Please help me. i am struggling with my code for last 4-5 hours