class usersView
{
private function info()
{
$sqlInfo = "SELECT * FROM `RegUsers`";
$mySql = new mysqli('localhost', 'root', '', 'GuestBook');
mysqli_query($mySql, "SET NAMES 'utf8' COLLATE 'utf8_general_ci'");
mysqli_query($mySql, "SET CHARACTER SET 'utf8'");
$resultSql = mysqli_query($mySql, $sqlInfo);
return $resultSql;
}
public function usersView()
{
$resultSql = $this->info();
while ($row = mysqli_fetch_assoc($resultSql)) {
echo 'Логин ' . $row['Log'] . '<br>';
echo 'Пароль ' . $row['Pass'] . '<br>';
echo 'Маил ' . $row['mail'] . '<br>';
echo 'Город ' . $row['town'] . '<br>';
echo 'Пол ' . $row['pol'] . '<br>';
echo 'Возраст ' . $row['years'] . '<br>';
echo 'Аватарка ' . $row['ProfPic'] . '<br>';
echo 'Статус ' . $row['status'] . '<br>';
echo '<hr>';
};
}
}
//НА Форме
<?
$user = new usersView();
$user->usersView();
?>
if($resultSql){
while ($row = mysqli_fetch_assoc()) {
/****/
}
}
class usersView
{
private function info()
{
$sqlInfo = "SELECT * FROM `RegUsers`";
$mySql = new mysqli('localhost', 'root', '', 'GuestBook');
mysqli_query($mySql, "SET NAMES 'utf8' COLLATE 'utf8_general_ci'");
mysqli_query($mySql, "SET CHARACTER SET 'utf8'");
$resultSql = mysqli_query($mySql, $sqlInfo);
return $resultSql;
}
public function usersView()
{
$resultSql = $this->info();
if ($resultSql) {
while ($row = mysqli_fetch_assoc($resultSql)) {
echo 'Логин ' . $row['Log'] . '<br>';
echo 'Пароль ' . $row['Pass'] . '<br>';
echo 'Маил ' . $row['mail'] . '<br>';
echo 'Город ' . $row['town'] . '<br>';
echo 'Пол ' . $row['pol'] . '<br>';
echo 'Возраст ' . $row['years'] . '<br>';
echo 'Аватарка ' . $row['ProfPic'] . '<br>';
echo 'Статус ' . $row['status'] . '<br>';
echo '<hr>';
};exit();
}
}
}
class usersView
{
private function info()
{
$sqlInfo = "SELECT * FROM `RegUsers`";
$mySql = new mysqli('localhost', 'root', '', 'GuestBook');
mysqli_query($mySql, "SET NAMES 'utf8' COLLATE 'utf8_general_ci'");
mysqli_query($mySql, "SET CHARACTER SET 'utf8'");
$resultSql = mysqli_query($mySql, $sqlInfo);
return $resultSql;
}
public function showUsers()
{
$resultSql = $this->info();
if ($resultSql) {
while ($row = mysqli_fetch_assoc($resultSql)) {
echo 'Логин ' . $row['Log'] . '<br>';
echo 'Пароль ' . $row['Pass'] . '<br>';
echo 'Маил ' . $row['mail'] . '<br>';
echo 'Город ' . $row['town'] . '<br>';
echo 'Пол ' . $row['pol'] . '<br>';
echo 'Возраст ' . $row['years'] . '<br>';
echo 'Аватарка ' . $row['ProfPic'] . '<br>';
echo 'Статус ' . $row['status'] . '<br>';
echo '<hr>';
};exit();
}
}
}
$user = new usersView();
$user->showUsers();
?>