Skip to content

Commit

Permalink
Update services.php
Browse files Browse the repository at this point in the history
  • Loading branch information
7h3h4ckv157 committed Aug 28, 2022
1 parent 67d05a5 commit b2b81c6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions services.php
@@ -1,20 +1,20 @@
<?php
// database connection code

if(isset($_POST['txtName']))
{
// $con = mysqli_connect('localhost', 'database_user', 'database_password','database');
$con = mysqli_connect('localhost', 'root', '','db_service');

// get the post records

$con = mysqli_connect('localhost', 'root', '','db');

$txtName = $_POST['txtName'];
$txtAdh = $_POST['txtAdh'];

$sanitized_txtName = mysqli_real_escape_string($db, txtName);
$sanitized_txtAdh = mysqli_real_escape_string($db, txtAdh);

// database insert SQL code
$sql = "INSERT INTO `tbl_service` (`Id`, `fldName`, `fldAdh`) VALUES ('0', '$txtName', '$txtAdh')";
$sql = "INSERT INTO `tbl_service` (`Id`, `fldName`, `fldAdh`) VALUES ('0', '$sanitized_txtName', '$sanitized_txtAdh')";

// insert in database
$rs = mysqli_query($con, $sql);

if($rs)
{
echo "Registered Succefully";
Expand All @@ -26,3 +26,4 @@

}
?>
c

0 comments on commit b2b81c6

Please sign in to comment.