HI
I have a number of custom fields I have created for the Users entity.
I have a sreen where the user can check off which client records to issue a cert. for (see screenshot).
On my php page, I am able to determine the RecID for each of the checked clients ok.
Then I have a loop which updates a date (if rec was selected) and then I need to grab the custom fields
that are on the Users entity for the appropriate ID and on a separate table for the Client of the User.
Below is my loop. However, something is wrong because I can't access the Types custom fields.
foreach ( $iSelectedRecs as $iRec_ID )
{
$sql = "UPDATE wp_transure_cust_clients ";
$sql .= "SET Acord_Date = \"$sNew_Acord_Date\" ";
$sql .= "WHERE Rec_ID = $iRec_ID";
$result = mysql_query($sql);
if (!$result)
{
echo 'Could not run query: ' . mysql_error();
exit;
}
$sql = "SELECT DISTINCT ID, display_name, user_email FROM wp_users ";
$sql .= "INNER JOIN wp_usermeta ON wp_users.ID = wp_usermeta.user_id ";
$sql .= "INNER JOIN wp_transure_cust_clients ON wp_transure_cust_clients.User_ID = wp_users.ID ";
$sql .= "WHERE wp_users.ID = $iCustID ";
$sql .= "AND wp_transure_cust_clients.Rec_ID = $iRec_ID ";
$result = mysql_query($sql);
if (!$result)
{
echo 'Could not run query: ' . mysql_error();
exit;
}
/* HERE ARE JUST A FEW OF THE CUSTOM FIELDS */
$user_id = $iCustID;
$single = true;
$key1 = "wpcf-status";
$sStatus = get_user_meta($user_id, $key1, $single );
$key2 = "wpcf-hdr-customer-name-address";
$sCustInfo = get_user_meta($user_id, $key2, $single );
.... other code goes here....
}
I visited this URL:
I expected to see:
Instead, I got: