Data not inserting to table

Asked by At

im trying to insert data to a table from another table. but its just one that is inserting (employeeid). its missing the (firstname and lastname) im making a attendance table here. i can give my codes to anyone can help. what should I do? im new to codings in general. and im trying to get this thing right.

include 'config.php';
if(isset($_POST['employeeid'])) {
    $ret=mysqli_query($con,"SELECT * FROM tbluser WHERE employeeid='$employeeid'");
        $sql=mysqli_query($con,"INSERT INTO attendance (employeeid, firstname, lastname, userIp, action) VALUES ('$employeeid', '$firstname', '$lastname', '$uip', '$action')");
        echo "<script>alert('Username or password is incorrect!')</script>";
        echo "<script>'index.php','_self')</script>";     

here is my html form

  <meta charset="UTF-8">
    <link rel="stylesheet" href="style.css" media="screen" type="text/css" />
<br><br><br><br><br><br><br><br><br><br><br><br><center><h1><b>WELCOME BRUH!‍</b></h1></center>
    function clock() {
var time = new Date(),

    hours = time.getHours(),

    minutes = time.getMinutes(),

    seconds = time.getSeconds();

document.querySelectorAll('.clock')[0].innerHTML = harold(hours) + ":" + harold(minutes) + ":" + harold(seconds);

  function harold(standIn) {
    if (standIn < 10) {
      standIn = '0' + standIn
    return standIn;
setInterval(clock, 1000);
    <div class="clock" style="font-family: 'Digital-7 Italic','Share Tech Mono', monospace; 
    font-size: 50px; color: #000000; 
    text-shadow: 0 0 20px rgba(255, 255, 255);  0 0 20px rgba(10, 175, 230, 0); 
    position: absolute;
    top: 200px;
    left: 685px;">
        <div class="container">
        <div id="login">
            <fieldset class="clearfix">
            <form action="loginprocess.php" name="login" method="POST">

            <p><span class="fontawesome-barcode"></span><input type="text"  placeholder="EmployeeID" name="employeeid" required></p>
            <p><input name="submit" type="submit" value="Sign In"></p>

                    <a href="admin.php">
                    <input type="submit2" value="ADMIN"/>

0 Answers