Passing select value from SQL database with php <p>I am attempting to use a select form that has fields populated from an SQL database. There is a table of stores in the database and I used this method to get those distinct fields into the select tool. </p> <pre><code>echo '&lt;select name="StoreName" /&gt;'."\n"; while ($row = mysqli_fetch_assoc($distinctResult)){ echo '&lt;option value="'.$row["StoreID"].'"&gt;'; echo $row["StoreName"]; echo '&lt;/option&gt;'."\n"; }; echo '&lt;/select&gt;'."\n"; </code></pre> <p>The correct store names show up on the select tool but when I submit the form data, the value of the form doesn't get passed properly. Here in the initial page: </p> <pre><code>&lt;?php require_once 'login.php'; $connection = mysqli_connect( $db_hostname, $db_username, $db_password, $db_database); if(mysqli_connect_error()){ die("Database Connection Failed: " . mysqli_connect_error() . " (" . mysqli_connect_errno() . ")" ); }; $query = "SELECT * from PURCHASE"; //echo $query; $result = mysqli_query($connection,$query); if(!$result) { die("Database Query Failed!"); }; $distinct = "SELECT DISTINCT StoreName FROM PURCHASE"; $distinctResult = mysqli_query($connection,$distinct); if(!$result) { die("Database Query Failed!"); }; echo '&lt;title&gt;Output 1&lt;/title&gt;'; echo '&lt;/head&gt;'; echo '&lt;body&gt;'; echo '&lt;h1&gt;Required Output 1&lt;/h1&gt;'; echo '&lt;h2&gt;Transaction Search&lt;/h2&gt;'; echo '&lt;form action="output1out.php" method="get"&gt;'; echo 'Search Store:&lt;br/&gt;'; echo '&lt;br/&gt;'; echo '&lt;select name="StoreName" /&gt;'."\n"; while ($row = mysqli_fetch_assoc($distinctResult)){ echo '&lt;option value="'.$row["StoreID"].'"&gt;'; echo $row["StoreName"]; echo '&lt;/option&gt;'."\n"; }; echo '&lt;/select&gt;'."\n"; echo '&lt;input name="Add Merchant" type="submit" value="Search"&gt;'; echo '&lt;/form&gt;'; mysqli_free_result($result); mysqli_close($connection); ?&gt; </code></pre> <p>And this is the output page: </p> <pre><code>&lt;?php $transaction = $_REQUEST["StoreName"]; require_once 'login.php'; $connection = mysqli_connect( $db_hostname, $db_username, $db_password, $db_database); $sql = "SELECT * FROM PURCHASE WHERE StoreName LIKE '%".$transaction."%'"; $result = $connection-&gt;query($sql); ?&gt; Purchases Made From &lt;?php echo $transaction ?&gt; &lt;table border="2" style="width:100%"&gt; &lt;tr&gt; &lt;th width="15%"&gt;Item Name&lt;/th&gt; &lt;th width="15%"&gt;Item Price&lt;/th&gt; &lt;th width="15%"&gt;Purchase Time&lt;/th&gt; &lt;th width="15%"&gt;Purchase Date&lt;/th&gt; &lt;th width="15%"&gt;Category&lt;/th&gt; &lt;th width="15%"&gt;Rating&lt;/th&gt; &lt;/tr&gt; &lt;/table&gt; &lt;?php if($result-&gt;num_rows &gt; 0){ // output data of each row while($rows = $result-&gt;fetch_assoc()){ ?&gt; &lt;table border="2" style="width:100%"&gt; &lt;tr&gt; &lt;td width="15%"&gt;&lt;?php echo $rows['ItemName']; ?&gt;&lt;/td&gt; &lt;td width="15%"&gt;&lt;?php echo $rows['ItemPrice']; ?&gt;&lt;/td&gt; &lt;td width="15%"&gt;&lt;?php echo $rows['PurchaseTime']; ?&gt;&lt;/td&gt; &lt;td width="15%"&gt;&lt;?php echo $rows['PurchaseDate']; ?&gt;&lt;/td&gt; &lt;td width="15%"&gt;&lt;?php echo $rows['Category']; ?&gt;&lt;/td&gt; &lt;td width="15%"&gt;&lt;?php echo $rows['Rating']; ?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php } } ?&gt; </code></pre> <p>I am calling the <code>select</code> name <code>StoreName</code> in the output page but it is not passing the value from the drop down. I need to run a query with that term on the second page so I can pull the relevant data for it. If anyone can see what I'm doing wrong, please advise. Thank you. </p>