Answer the question
In order to leave comments, you need to log in
How to filter content?
I can't figure out how to filter the material?
Sample from the database
$sql = $pdo->prepare("SELECT xf_list.id as id_f, xf_list.title as title_f, xf_list.url as url_f, xf_category.id as id_c, xf_category.title as title_c, xf_type.title as title_t, xf_type.url as url_t FROM `xf_list` LEFT JOIN `xf_category` ON `xf_list` . `category_id`=`xf_category` . `id` LEFT JOIN `xf_type` ON `xf_list` . `type_id`=`xf_type` . `id`");
$sql->execute();
$result = $sql->fetchAll(PDO::FETCH_OBJ);
<table class="table shadow ">
<thead class="thead-dark">
<tr>
<th>#</th>
<th>Name</th>
<th>Currency</th>
<th>MicroWallet</th>
<th>Visit</th>
</tr>
<?php foreach ($result as $value) { ?>
<tr>
<td><?=$value->id_f ?></td>
<td><a href="<?=$value->url_f ?>" target="_blank"><?=$value->title_f ?></a></td>
<td><?=$value->title_c ?></td>
<td><a href="<?=$value->url_t ?>" target="_blank"><?=$value->title_t ?></a></td>
<td><a class="btn btn-primary" href="<?=$value->url_f ?>" target="_blank" role="button">View</a></td>
<?php } ?>
</tr>
</thead>
</table>
<?=$value->title_t ?>
<?=$value->title_c ?>
Answer the question
In order to leave comments, you need to log in
Pass data for the filter in get parameters, process them on the backend and add the appropriate conditions to the request.
PS: Why, I wonder, do you prepair if you don't use prepared expressions??? How about USE prepared expressions?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question