Hi,

I have this code that selects the value of a combobox and it inserts into a input:

<?php
                        echo '<input id="matr_input" style="margin-left:15px;margin-top:10px;" name="id_cat"></input>';



                        $select_images="SELECT * FROM categories WHERE id_category='"./*combobox value*/."'";
                        $query_images=mysql_query($select_images) or die(mysql_error());
                        $image=mysql_fetch_assoc($query_images);
                     ?>
                        <?php
                          $nome_arquivo = $image['img_category'];
                          $arquivo = explode('images/', $nome_arquivo);

                          if($image['img_category']!=''){
                            echo '<div style="margin-left:15px;">'.$arquivo[1].'<a href="delete_category.php?id='.$image['id_category'].'"><img width="10" style="margin-top: 1px; margin-left: 2px;" src="cross-on-white.gif"></a></div> <br />';
                          }
                        ?>


                    <script>
                      function displayVals() {
                        var singleValues = $("#gallery_category_filter").val();
                        var multipleValues = $("#multiple").val() || [];
                        $("input#matr_input").val("" +
                           singleValues +
                           "" +
                           multipleValues.join(", "));
                      }
                      $("select").change(displayVals);
                      displayVals();
                    </script>

But instead of a input i want it to insert in this query:Select

$select_images="SELECT * FROM categories WHERE id_category='"./*combobox value*/."'";
                            $query_images=mysql_query($select_images) or die(mysql_error());
                            $image=mysql_fetch_assoc($query_images);

Can someone help me, please?

Thank you,
PF2G

Member Avatar for diafol

Do you want to pass the value to ajax or just send the form to the server on select?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.