I am trying to retrieve the user-id based a users username. Community Builder doesn't have a username column in the #_comprofiler table. Then I wish to retrieve the members paypal info from the cb_paypal field in #_comprofiler
Once I have the user-id I can then use the information in the #_comprofiler table.
Here is what I have tried.
Code: Select all
$sql = "SELECT jospk_users.username, jospk_users.id, jospk_comprofiler.user_id, jospk_comprofiler.cb_paypal FROM `jospk_users`,`jospk_comprofiler` WHERE jospk_users.username = $g AND jospk_users.id = jospk_comprofiler.user_id";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<br>Id = ".$row[id]." Username = ".$row[username]." Paypal is:".$row[cb_paypal];
} //end while