V
V
Vladimir2018-01-26 23:00:33
PHP
Vladimir, 2018-01-26 23:00:33

How to enter data from the cycle into one table model?

Retrieving data from the database using a while loop:

while ($row = $db->get_row()) {
  echo "<a href='/user/".$row['name']."'>".$row['name']."</a>, " ;
}

well, after that there is a table in which you need to enter all $row['name'] into certain cells (you need to enter it out of order!)
Tell me how to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2018-01-26
@vovaburyii

$names = [];
while ($row = $db->get_row()) {
  $names[] = $row['name']
  echo "<a href='/user/".$row['name']."'>".$row['name']."</a>, " ;
}
//... сортируйте как вам надо 
foreach ($names as $name) {
echo $name;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question