I want to show all users from another wordpress installation. I need to show their names and some others metadata. I've trying to do the following code, but I was not able to show the metas separated.
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = 'SELECT * FROM sbdspass_usermeta';
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo $row["meta_value"]; // SHOW THE FIRST NAME
echo $row["meta_value"]; // SHOW THE LAST NAME
}
} else {
echo "0 results";
}
$conn->close();
I want to show a list of user, for then implement a search query