[insert_php]

if(isset($_POST[‘post’]))
{
try{
$host = ‘localhost’;
$dbname = ‘uzchsrsc’;
$username = ‘root’;
$password =”;

$dbh = new PDO(‘mysql:host=$host;dbname=$dbname’,$username,$password);

}

catch(PDOException $e)
{
echo $e->getMessage();
}
$project_title = $_POST[‘project_title’];
$field_of_research = $_POST[‘field_of_research’];
$funding_agency = $_POST[‘funding_agency’];
$budget = $_POST[‘budget’];
$pi = $_POST[‘pi’];
$start_date = $_POST[‘start_date’];
$end_date = $_POST[‘end_date’];
$institution = $_POST[‘institution’];
$title = $_POST[‘title’];
$gender = $_POST[‘gender’];
$position = $_POST[‘position’];
$email = $_POST[’email’];
$phone = $_POST[‘phone’];
$co_investigator = $_POST[‘co_investigator’];
$department = $_POST[‘department’];
$co_investigator1 = $_POST[‘co_investigator1’];
$institution1 = $_POST[‘institution1’];
$department1 = $_POST[‘department1’];
$co_investigator2 = $_POST[‘co_investigator2’];
$institution2 = $_POST[‘institution2’];
$department2 = $_POST[‘department2’];
$study_site = $_POST[‘study_site’];
$publication1 = $_POST[‘publication1’];
$publication2 = $_POST[‘publication2’];
$publication3 = $_POST[‘publication3’];

$query = ‘insert into `research_table` values(?,?, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)’;
$prepared_query = $dbh->prepare($query);
$prepared_query->execute([$project_title, $field_of_research,$funding_agency,$budget,$pi,$start_date,$end_date,$institution,$title,$gender,$position,$email,$phone,$co_investigator,$department,$co_investigator1,$institution1,$department1,$co_investigator2,$institution2,$department2,$study_site,$publication1, $publication2,$publication3]);

}
else
{
echo ”

Male
Female

“;
}

[/insert_php]