Here’s the situation.
I have two table in a DB: tblcustomfieldsvalues (for custom fields entry) and tblclients (contains client list).
tblcustomfieldsvalues has following data structure:
id => 10
relid => 13
data => somedataentry
id => 10
relid => 21
data => someotherdataentry
tblclients has following data structure:
id => 13
firstname => somename
lastname => somelastname
I have this code to create an array of relids which have id = 10:
$sql = mysqli_fetch_array(mysqli_query("SELECT * FROM `tblcustomfieldsvalues` WHERE `id` = '10'"));
$cids = array();
while ($row = $sql)
{
array_push($cids, $row['relid']);
}
Now that I have user IDs of those who have filled their custom fields with some data in the $cids array, how can I get those users details from tblclients?
Thanks in advance.
Sounds like you just need to use an
INNER JOIN:Good luck!