D
D
DmitrijP2019-12-27 20:13:38
css
DmitrijP, 2019-12-27 20:13:38

Data output based on hyperlink?

Hello again!
There is a DB MYSQL and a hyperlink that looks like this:
localhost/baze/inventory.php?inv=inv651 (it simulates a future hyperlink encrypted in qr),
how to get this inv (if I remember correctly, something like this: $_GET['inv' ]), and how to display the data from the table with such an inv after receiving the data? Now the data output from the database looks like this:

code (it looks massive, I warned you)

<?php
      $connection = mysqli_connect("localhost","root","");
$db = mysqli_select_db($connection,'logins');
      $query = "SELECT * FROM test";
      $query_run = mysqli_query($connection,$query);
      ?>
        <table >
          <thead >
        <tr>
          <th scope="col">#</th>
          <th scope="col">Инв. номер</th>
          <th scope="col">Название</th>
          <th scope="col">Цена</th>
          <th scope="col">Пользователь</th>
          <th scope="col" >Функции</th>
        </tr>
        </thead>
        	<?php
      if($query_run)
      {$i = 1;
        foreach($query_run as $row)
        {
        
          ?>
        <tbody>
        <tr >
        <td> <?php 	echo  $row['id'];
        ?>
        </td>
          <td> <?php 	echo  $row['invnum'];?></td>
          <td> <?php 	echo  $row['name'];?></td>
          <td> <?php 	echo  $row['price'];?></td>
          <td> <?php 	echo  $row['user'];?></td>
          <td> 
            <button type="button" class="btn btn-success editbt">Правка</button>
          </td>
          <td> 
            <button type="button" class="btn btn-danger delbt">Удалить</button>
          </td>
            <td> 
            <button type="button" class="btn btn-primary checkbt">Отметить</button>
          </td>
        </tr>
        </tbody>
      <?php
        
        }	
      }
      else{
        echo'Записи не найдены';	
      }
      ?>
      </table>


I would be glad for your help, O great Tosterians!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem Chernyavsky, 2019-02-27
@cherniasvky94

If you don’t bother, then with the help of https://masonry.desandro.com/layout.html ))

A
Andrew, 2019-02-27
@ellenripley4

Use the power of CSS Grid, build very quickly and easily.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question