Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = '127.0.0.1'; // Host del database
- $db = 'furniture_test'; // Nome del database
- $user = 'root'; // username
- $pass = 'root'; // password
- $dsn = "mysql:host=$host;dbname=$db";
- $pdo = new PDO($dsn, $user, $pass);
- // Prelevo i parametri passati dalla richiesta
- $model_id = $_GET['model'];
- $texture_id = $_GET['texture'];
- // Ottengo l'immagine combinata
- $statement = $pdo->query("SELECT * FROM images WHERE id_model = $model_id AND id_texture = $texture_id");
- $image = $statement->fetch();
- // Ritorno il percorso dell'immagine
- echo json_encode(array(
- 'picture' => $image['img_path']
- ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement