I need to select data from one MySQL table and match an ID from the query to get an email address from the second table. Then output the results. My current code is:
$sql = "SELECT fk_i_user_id, i_amount FROM osei_t_payment_pro_wallet
WHERE i_amount > 0 order by i_amount DESC";
$rows = mysqli_query($conn, $sql);
while ($rs = mysqli_fetch_array($rows, MYSQLI_ASSOC)){
$uid = $rs["fk_i_user_id"];
$cash = $rs["i_amount"] / 1000000;
echo "User ID - ".$uid." Wallet Val - ".$cash.chr(10).chr(13);
}
I would like to incorporate in this query:
"SELECT s_email FROM osei_t_user where pk_i_id =".$uid;
And output the results:
echo "User ID - ".$uid." Wallet Val - ".$cash." - Email: ".(value from above query).chr(10).chr(13);