I'm building a very basic html website for use on a smartphone, which would look something like this
<body>
Some Text
<form name="input" action="query.php" method="get">
Search: <input type="text" name="search">
<input type="submit" value="Submit">
</form>
</body>
Then in the query.php I have this
select ProductName, PalletSpace, Quantity, TransactionDate from Table1
having Table1.PalletSpace='B005E';
How can I link the two up so that the text typed into the search box is inserted into the query (where it says B005E?)?
EDIT: query.php now contains this:
<?
$username="xxx";
$password="xxx";
$database="xxx";
$con = mysqli_connect("xxx", "xxx", "xxx", "xxx");
$result = mysqli_query($con, "SELECT ProductName, PalletSpace, Quantity, TransactionDate FROM ProductTrans
WHERE ProductName = ($_REQUEST["search"])");
echo "<table border='1'>
<tr>
<th>Product Code</th>
<th>Pallet Space</th>
<th>Quantity</th>
<th>Date</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['ProductName'] . "</td>";
echo "<td>" . $row['PalletSpace'] . "</td>";
echo "<td>" . $row['Quantity'] . "</td>";
echo "<td>" . $row['TransactionDate'] . "</td>";
echo "</tr>";
}
echo "</table>";
?>
query.php and the html file (which is still the same) are in the same directory. However, when I try a search, it gives me this error
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/u921305435/public_html/query.php on line 11