Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Menù a tendina PHP e MYSQL

    Posto il codice. GRAZIE

    <select name="marca">
    <?php
    $query1=mysql_query("SELECT * FROM marche ORDER BY marche ASC");
    while($row1=mysql_fetch_array($query1)){
    echo"<option value=\"$row1[marche]\">$row1[marche]</option>";}?>
    </select>

    <select name="allestimento">
    <?php

    $all= ???? COSA CI DEVO METTERE QUI PER FAR IN MODO CHE QUANDO SELEZIONO LA MARCA SUL MENU SOPRA MI COMPAIANO SOLO GLI ALLESTIMENTI DI QUELLA MARCA????

    $query2=mysql_query("SELECT * FROM allestimento WHERE marche='$all' ORDER BY allestimento ASC");
    while($row2=mysql_fetch_array($query2)){
    echo"<option value=\"$row2[allestimento]\">$row2[allestimento]</option>";}?>
    </select>

    il database ha due tabelle
    "marche" contiene 1 campo "marche"
    "allestimento" contiene 2 campi "marche" e "allestimento"
    Il Presente è il Passato del tuo Futuro... Aspettando il 21.12.2012...

  2. #2

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.