Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'database.php';
- $category=trim($_POST['category']);
- $description=trim($_POST['description']);
- $SQLStatement = $con->prepare("INSERT INTO `PC_Components`( `category`, `description`) VALUES (?,?)");
- $SQLStatement->bind_param("ss", $category, $description);
- $rc = $SQLStatement->execute();
- if (true===$rc) {
- echo json_encode(array("statusCode"=>200));
- }
- else {
- echo json_encode(array("statusCode"=>201));
- }
- //connection closed.
- ?>
Advertisement
Add Comment
Please, Sign In to add comment