The program below is just a simple test to see if I can get it to fetch the correct data from MariaDB and then display it on the screen but so far I'm not having any luck. I left the action attribute's value blank because I want the PHP form processing to be executed in the same page. I'm trying to get $name & $tdoc to display on the screen. $tdoc is the data I use to select the correct row and then I'd like to display that along with $name. Thanks for any and all replies.
<?php
// open a DB connectiong
$servername = "localhost";
$username = "username";
$password = "password";
$connection = new mysqli($servername, $username, $password, "popcount");
// check connection
if($connection->connect_error)
{
die("Connection Failed!: " . $connection->connect_error);
}
?> <html> <form name='tdoc' method='post'>
Please Enter Inmate TDOC# <input type='text' /> <input type='submit' /> </form> </html> <?php
$tdoc = $_POST["tdoc"];
$name = $connection->query("SELECT full_name FROM inmate_board WHERE tdoc_number = $tdoc");
echo "$name<br />";
echo "$tdoc";
?>