Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "root";
- $dbname = "yourdb";
- $con=mysqli_connect($host,$username,$password,$dbname);
- // Check connection
- if (mysqli_connect_errno())
- {
- echo "Failed to connect to MySQL: " . mysqli_connect_error();
- }
- // Retrieve product info
- $list=mysqli_query($con, "select products_reference from products");
- ?>
- <form>
- <select>
- <option value="">--- Select ---</option>
- <?php while($row_list=mysqli_fetch_assoc($list)) { ?>
- <option value="<? echo $row_list['column_id']; ?>"> // Change column_id into id of item
- <? echo $row_list['column_reference'];?> // Change column_refrerence into item name
- </option>
- <?php } ?>
- </select>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement