Answer the question
In order to leave comments, you need to log in
How to display information from the database to the site?
Ladies and gentlemen - I need help! I want to bring their database to the site the value of an arbitrary field. What is the point - the system displays a table of students, and so I made a column - Rating of good.
So I wrote in such a way that it displays all the ratings as you can see (102015), but I need to display a separate rating for an individual student.
Here is the db table
And here is my masterpiece of php art.
<?php
$host = 'localhost';
$user = 'u0818_scr';
$pass = 'cfqfhtyttyj19';
$db_name = 'u0818';
$link = mysqli_connect($host, $user, $pass, $db_name);
if (!$link) {
echo 'Не могу соединиться с БД. Код ошибки: ' . mysqli_connect_errno() . ', ошибка: ' . mysqli_connect_error();
exit;
}
?>
<?php
$sql = mysqli_query($link, 'SELECT * FROM `wpps_custom_field_metas` WHERE `field_value`');
while ($result = mysqli_fetch_array($sql)) {
echo "{$result['field_value']}";
}
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question