Nnirvi
Member
Hi!
I'm trying to retrieve a value from the said table but when it comes to MySQL, I'm pretty clueless. The table has all the custom field values, I'm trying to get user ID based on a custom field (customernumber). So right now it's looking like this:
$customernumber is defined before the query.
I'm trying to retrieve a value from the said table but when it comes to MySQL, I'm pretty clueless. The table has all the custom field values, I'm trying to get user ID based on a custom field (customernumber). So right now it's looking like this:
Code:
$result_id = $db->fetchRow("SELECT COUNT(*) AS fetchid FROM xf_user_field_value WHERE field_value=" . $db->quote($customernumber) . " AND field_id='customernumber'");
$fetched_id = $result_id[1];
$customernumber is defined before the query.