I need help understanding how to insert values into a mysql database. I understand I will need to write a INSERT statement of the data that I get from the user. But I dont really understand where to put this insert statement and how to get it to run. Do I use pg_prepare and pg_execute? If someone could just help me set my code up to where I would run the insert statement I would greatly appreciate it! Thanks for the help in advance.
HTML code
<!DOCTYPE html>
<html>
<body>
<form method="POST", action="Blast.php">
<select id="database" name="database" value='Select a Database'>
<option value="UniprotKB">UniProtKB</option>
<option value="GenBank">GenBank</option>
<option value="RelSeq">RelSeq</option>
</select>
<select id="evalue" name="evalue" value='Select evalue'>
<option value="0.0001">0.0001</option>
<option value="0.001">0.001</option>
<option value="0.01">0.01</option>
<option value="0.1">0.1</option>
<option value="1">1</option>
<option value="10">10</option>
<option value="100">100</option>
<option value="1000">1000</option>
</select>
<input id="BlastSearch" type="text" name="BlastSearch" value='' />
<input type='submit' name='submit' value='Run BLAST' />
<button type="reset" value="Clear">Clear</button>
</form>
So there are basically 3 values that are inserted by the user, and I want to insert them all into the database when the submit button is pressed!
PHP Code
<?php
require_once '../secure/database.php';
$mysqli = new mysqli($dbhost,$dbuser,$dbpass,$dbname);
if($mysqli->connect_error){
exit('CON Error: ' . $mysqli->connect_errno . ' ' . $mysqli->connect_error);
}
$db = $_POST['database'];
$evalue = $_POST['evalue'];
$sequence = $_POST['BlastSearch'];
print "Connected! Host info: " . $mysqli->host_info . "<br>\n";
$mysqli->close();
?>