Answer the question
In order to leave comments, you need to log in
How to send and receive response from php via ajax?
Hello. There is this form: https://jsfiddle.net/n3xz195L/ . The data in the table that you see is written like this
$query = "SELECT * FROM main ORDER BY id DESC";
$result = mysqli_query($link, $query);
if (!$result) {
die(mysqli_error($link));
}
$n = mysqli_num_rows($result);
$articles = array();
for ($i=0; $i < $n; $i++) {
$row = mysqli_fetch_assoc($result);
$articles[] = $row;
}
return $articles;
<?php foreach($articles as $a): ?>
<tr>
<td class="formid"><?=$a['id']?></td>
<td><?=$a['namenomer']?></td>
<td><?=$a['datestart']?></td>
<td><?=$a['dateend']?></td>
<td><?=$a['nameclient']?></td>
<td><?=$a['phoneclient']?></td>
</tr>
<?php endforeach ?>
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