i have a table which is populated of database data.
<table class="table table-bordered">
<thead>
<tr>
<th>Product Name</th>
<th>Brand</th>
<th>Category</th>
<th>Featured</th>
</tr>
</thead>
<tbody>
<?php foreach($products as $product){ ?>
<tr>
<td><?= $product->name; ?></td>
<?php $brand->select("brand","products_brands")->where("id")->build();
$pbrand = $brand->execute(array($product->brand))->fetch();?>
<td><?= $pbrand->brand; ?></td>
<?php $category->select("category,parent","products_categories")->where("id")->build();
$procatChild = $category->execute(array($product->category))->fetch();
$category->select("category","products_categories")->where("id")->build();
$procatParent = $category->execute(array($procatChild->parent))->fetch(); ?>
<td><?= $procatParent->category. " - " .$procatChild->category; ?></td>
<td>
<a id="afeat" href="products.php?product_id=<?= $product->id;?>&featured=<?= $product->featured;?>" class="btn btn-default btn-sm">
<span class="<?= ($product->featured == 0) ? "fa fa-times-circle" : "fa fa-check-circle"; ?>"></span>
</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
now i want to update the featured field by clicking the a tag, but i didnt know how to pass the url parameters to ajax data to send it to php update script.I have been looking for the same problem but i didnt find concrete solutions. Thanks in advance guys