<form method="POST">
Color: <select name="Color">
<option> </option>
<option name="red"> Red</option>
<option name="royal"> Royal Blue</option>
<option name="black"> Black</option>
<option name="white"> White</option>
<option name="yellow"> Yellow</option>
<option name="navy"> Navy</option>
<option name="green"> Green</option>
<option name="gray"> Gray</option>
<option name="blue"> Blue</option>
</select><br>
<input type="Submit" name="Submit"value="Save">
<?php
if (isset($_POST['Submit']))
{ $con=mysqli_connect("localhost","root","","inventory");
$result = mysqli_query($con,"SELECT * FROM color");
$red=$_POST['red'];
$royal=$_POST['royal'];
$black=$_POST['black'];
$white=$_POST['white'];
$yellow=$_POST['yellow'];
$navy=$_POST['navy'];
$green=$_POST['green'];
$gray=$_POST['gray'];
$blue=$_POST['blue'];
mysql_query("INSERT INTO `inventory`.`color`(red,royal,black,white,yellow,navy,green,gray,blue)
VALUES ('$red','$royal','$black','$white','$yellow','$navy','$green','$gray','$blue')");
}?>
Anthony_6 0 Newbie Poster
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.