I am new to ionic and angularjs and trying to display store information base on the id of the selected category so this my question how can I get the categoryid them pass it to my get request the retrieve the store data and display it
I try doing something like this
<ion-col width-25 no-margin no-padding *ngFor="let item of Category">
<ion-card (click)="Store({{item categoryid}})">
<img images-filter src="{{item.IMAGE}}" />
<div class="card-description">
<div card-title>{{item.NAME}}</div>
</div>
</ion-card>
</ion-col>
and in the services did this
GetOfferByID(ID){
const ID = {CategoryID};
this.GetID.push(ID);
const headers = new Headers();
headers.append('Content-Type','application/json; charset=utf-8');
this.http.post('http://localhost:8888/PeopleService/GetStore&Offers/GetStore.php?CategoryID=ID',JSON.stringify(ID),headers).subscribe(
()=>{},
err=>console.error(err)
);
}
and lastly this is my sql
<?php
require_once'../db_config.php';
$stringid=$_GET['CategoryID'];
$arr = array();
$sql = "SELECT store.NAME, pictures.PICPATH,store.WEBSITE ,store.DESCRIPTION ,`CATEGORYID` FROM `store` LEFT JOIN pictures ON store.STOREID= pictures.STOREID WHERE store.CATEGORYID='$stringid'";
$select_users = $conn->query($sql);
if(!$select_users){
die('Query Failed' . mysqli_error($conn));
}
while($row = $select_users->fetch_assoc()) {
$arr[] = $row;
}
echo json_encode($arr);
?>
but as expected it did not work so I was wondering what is the correct way to do it