Hi, I would like to upload 15 images on my webshop, I am using: HTML, JAVASCRIPT, PHP and i want to retrieve it from my database phpmyadmin

This is my php code if ($method == 'GET') {

switch ($uri[0]) {

    case 'products':
        // fetching all products

        try {
            $stmt = $conn->prepare('SELECT * FROM `products` LIMIT 15');
            // $stmt2 = $conn->prepare('SELECT * FROM `users`');

            $stmt->execute();
            // $stmt2->execute();
            $stmt->setFetchMode(PDO::FETCH_ASSOC);
            // $stmt2->setFetchMode(PDO::FETCH_ASSOC);

            $result = $stmt->fetchAll();
            // $result2 = $stmt2->fetchAll();

            // echo json_encode($result2);
            echo json_encode($result);
        } catch (PDOException $e) {
            $error = $e->getProducts();

        }
        break;

So what can I add in my javascript code and html code? I have a table in phpmyadmin for images and a map saved in my pc with all my images called images.



Read more here: https://stackoverflow.com/questions/66268380/hi-i-would-like-to-upload-15-images-on-my-webshop-i-am-using-html-javascript

Content Attribution

This content was originally published by jason at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: