Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $user = "root";
- $pass = "";
- $host = "localhost";
- $dbname = "neardeal";
- $store_id = $_REQUEST['store_id'];
- // Create connection
- $conn = new mysqli($host, $user, $pass, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- //get data
- $sql = "SELECT * FROM product WHERE store_id={$store_id}";
- //
- $result = $conn->query($sql);
- $products = array();
- while($row = $result->fetch_assoc()) {
- $products[] = $row;
- }
- echo json_encode(array(
- 'success' => true,
- 'product' => $products
- ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement