I am trying to make an order status page where I will manually adjust in the phpmyadmin however I'd like people to be able to use a form to put in their order number then be given the appropriate name and status attatched to that order number.
This is index.php
<?php
$username = "username";
$password = "password";
$hostname = "localhost";
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "Connected to MySQL<br>";
?>
<form method="POST" action="action.php">
<input type="text" name="term" />
<input type="submit" value="Submit" name="submit" />
</form>
This is my action.php
<?php
$username = "evo_readle";
$password = "judo08";
$hostname = "localhost";
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "Connected to MySQL<br>";
$term = mysql_real_escape_string($_REQUEST['term']);
$query = mysql_query("SELECT * FROM orders WHERE number ='%".$term."%'");
$user = mysql_fetch_assoc($query);
echo "Hello User, your name is" .$user['name'];
?>