Can't display data from mysql using php.?

There is a MySQL database, there is an html site, you need to withdraw from this database information, of course this is done through php. But nothing happens. The original Toolkit:
- ROSA Linux;
- Apache;
- php;
- MySQL;
Throw the code below:
The database is connected, everything is OK, the html it finds (the database name), but nothing displays.
$link = mysqli_connect('localhost','root','0000','html');
//test connection:
if(mysqli_connect_errno())
 die('connection Error: '.mysqli_connect_error()); //or if(!$link) {..
else { //if successful
 echo (mysql_error());
}
//mysql_set_charset('utf8_general_ci', $link);

$res = mysqli_query("SELECT * FROM `table`");
if($res) { //if the request is successful
 while($row = mysqli_fetch_assoc($res)) {
 //print how we need
print_r($row);
}
 mysqli_free_result($res); //clear the memory occupied - it is no longer needed
}
mysqli_close($link);
July 9th 19 at 13:44
2 answers
July 9th 19 at 13:46
Solution
RTFM
$res = mysqli_query($link, "SELECT * FROM `table`");
I tried displays, but encoding how to put and where the function to change the character encoding? - Shana_Hal commented on July 9th 19 at 13:49
: manual use is in the scrap?
php.net/manual/en/mysqli.set-charset.php - kavon.Murphy commented on July 9th 19 at 13:52
: Lots of things break, and how not found, thanks, everything is fine - Shana_Hal commented on July 9th 19 at 13:55
July 9th 19 at 13:48
Solution
In the site logs?
I don't use log - Shana_Hal commented on July 9th 19 at 13:51
I have a small html website, file, to display the data. - kavon.Murphy commented on July 9th 19 at 13:54
: Log'a no, the folder is empty - Shana_Hal commented on July 9th 19 at 13:57
: Then there is no point in guessing. If any errors are, then they are recorded in the logs. - Shana_Hal commented on July 9th 19 at 14:00
: How in the logs to find an error about a completely different problem? I have the database well connected, I thought the sql query is not correct. - Shana_Hal commented on July 9th 19 at 14:03
: So if there are errors, they are just in the Apache logs will be shown. This is the first place in search of problems. If there are no errors there, then we will have to look for them in the program logic. - Shana_Hal commented on July 9th 19 at 14:06
Log apache so you need to use? Gee I mysql log look - Kenyatta commented on July 9th 19 at 14:09
: Nothing What kind of should be mistakes? - Shana_Hal commented on July 9th 19 at 14:12

Find more questions by tags MySQLPHP