17.10.2013, 12:50
Quote:
Ok umh, i was checking my db and i have this tables:
dsb_user_photo and inside that table, there is the "photo" column, so i guess is where is stored the profile pic of the member. For username, i have this table: dsb_user_profiles and there is "_user" column where are stored all the usernames. So i have to read 2 different tables and 2 different columns. I made this code to show last 5 registered members (without photo): PHP код:
PHP код:
|
PHP код:
$query = mysql_query("SELECT * FROM `dsb_user_profiles` ORDER BY `id` DESC LIMIT 5");
while($row = mysql_fetch_assoc($query))
{
$admin = $row['_user'];
$querya = mysql_query("SELECT * FROM `dsb_user_photo` WHERE `_name` = '$admin'");
while($rowa = mysql_fetch_assoc($querya))
{
$image = $rowa['photo'];
}
echo "$admin<br>";
echo "<img src=\"$image\"><br>";
}