I am building a custom part builder and I am trying to make it search the MySQl Database by the Part Number that is generated and then output the price into cell in a table. I can't figure out how to make it search by the Part Number that is generated and output the price. The Part Number is generated by Javascript but an example part number would be 133-FTHxFTH-075-N1-00. Here is my Ajax script
var request = $.ajax({
url: "http://localhost/filenamehere.php",
type: "post",
data: "partnumber"
});
request.done(function (response) {
document.getElementById("price1").innerHTML = response;
});
Here is my PHP Code
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT 'LDS_Price_$' FROM list where
Part_Number=**This is wher the generated part number would go** ");
echo "<table border='1'>
<tr>
<th>LDS Price $</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['LDS_Price_$'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>`