database - Dynamic data for produkt list, search form select ,php mysqli -
i looking solution create dynamic data table print 3 variables mysqli database defined 3 select variables.
the idea after make selection of categories want display , press button search refreshing page , sending variables. after table made.
note : page within iframe , images have same name.jpg id them , list should render in horizontal rows , 4 columns row
i think picture worth of thousand words add 1 of code now.
picture link< image link (i dont have 10 reputation post images , lol)
<head> <link rel="stylesheet" href="../css/style.css"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <body> <div id="search_wrapper"> <!-- color--> <li> <img class="img_search_bar" src="../img/search/color.jpg" /> <select> <option value="">all</option> <option value="">blue</option> <option value="">red</option> <option value="">black</option> <option value="">white</option> </select> </li> <!-- size--> <li> <img class="img_search_bar" src="../img/search/size.jpg" /> <select> <option value="">all</option> <option value="">small</option> <option value="">medium</option> <option value="">big</option> </select> </li> <!-- type--> <li> <img class="img_search_bar" src="../img/search/type.jpg" /> <select> <option value="">all</option> <option value="">sewing</option> <option value="">sticking</option> <option value="">ironing</option> </select> </li> <div id="button_search"> <a href="produkt.php">search</a> <!-- refresh page--> </div> </div> <table id="produkt_table"> <td> <img class="produkt_ikon" src="../img/produkt/ikon/3.jpg"> <h3> id : $id </h3> <h4> prize : $prize </h4> <h5> stock : $yes/no </h5> </td> </table> <?php //mysqli connection on localhost $db = mysqli_connect("localhost", "root","" ,"test"); if (mysqli_connect_errno()) { echo mysqli_connect_error(); exit(); } //selecting database mysql_select_db("test"); //making query $query = mysql_query("select `id`, `prize`, `stock` `testtable`"); //while loop printing list of parameters while ($row = mysql_fetch_array($query, mysql_both)) { printf ("id: %s prize: %s stock: %s <br>", $row[0], $row["prize"], $row["stock"]); } mysql_free_result($query); ?> </body>
Comments
Post a Comment