ohctech_p8/save_habit.php
Dushant Mali 899fb3e65a Upgrade 7 to 8
Upgrade 7 to 8
2024-11-02 18:03:13 +05:30

22 lines
508 B
PHP

<?php
include('includes/config/config.php');
include('includes/functions.php');
include('log_entry.php');
$habit_id = $_POST['habit_id'];
$habit = $_POST['habit'];
if (!empty($habit_id)) {
$in = "update";
$en = " where habit_id = '" . $habit_id . "'";
} else {
$in = "insert into ";
$em = '';
}
$query = $in . " habits set habit = '$habit',modified_by='" . $_SESSION['user_id'] . "'" . $en;
error_log($query);
if (!$result = @mysqli_query($conn, $query)) {
die(mysqli_error($conn));
}