I am making a simple review application. The below image is my DB schema:
Here is the PHP I am using to accept the post request:
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = ($_POST["name"]);
$title1 = ($_POST["phone"]);
$title2 = ($_POST["myphone"]);
// check if name only contains letters and whitespace
$image = ($_POST["stars"]);
// check if name only contains letters and whitespace
mysql_query("insert into `PeerReview`
( `ReviewerPhoneNumber`, `RevieweePhoneNumber`,
`RevieweeName`, `Comments`, `Stars` )
values ( '".$title2."', '".$title1."', '".$name."', '".$image."', '".$image."')");
if (mysql_error()) {
die(mysql_error());
echo '
<div class="post" style="border-bottom:1px black solid;">
<h3>Thank You!</h3>
</div>
</body>
</html>';
die();
}
}
I am using Postman to send the post request:
The result is a new row being added to my DB with an Auto-incremented ID, but blank values for every other column. This is incorrect because as you can see in Postman I am accurately adding the parameters. I have made many PHP applications before using this same technology stack. I would appreciate any direction.