E
E
eratnikstudio2020-06-10 02:54:31
PHP
eratnikstudio, 2020-06-10 02:54:31

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.
5ee02060a923b410717335.png
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
5ee020e02d08e536663559.png

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']}";
  }
?>


How to make them in the table on the site in their places?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
eratnikstudio, 2020-06-10
@eratnikstudio

I still don't understand. How and where to do it? )))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question