I would like to know how to insert this object method:
$object = new User;
echo $object->getAllUsers();
within this PHP/HTML attribute of "src":
echo "<a href='#'>
<img id='#' src='#howtoinsert?'></a>;
...because that object method contains the data $uid
from my database that I want to echo out. I've tried many ways but they will not work. How would I do this?
This is the "Class User" that contains that object method:
class User extends Dbh {
public function getAllUsers() {
$stmt = $this->connect()->query("SELECT * FROM indeximg");
while ($row = $stmt->fetch()) {
$uid = $row['username'];
return $uid;
}
}
}