dimanche 12 août 2018

How to run a PHP script in Javascript [duplicate]

This question already has an answer here:

I want to get the designation value to use it in my JS, but the PHP code does not work. How can I launch this query?

function updauting(clicked_id) {
    <?php
        $cat = $db->prepare("SELECT idCategory, category.designation FROM category WHERE category.idCategory = ?", clicked_id); "
    ?>

    document.getElementById("category").value = $cat[0]->designation;
}




Aucun commentaire:

Enregistrer un commentaire