How do I delete rows from two tables with ID in MySQLi using php

0 votes

I want to delete rows in two diffrent tables usinng a connected ID. I have tried diffrent things but now I'm stuck here.

if(isset($_POST['delete'])){

   

   

    $Loginid = mysqli_real_escape_string($con,$_POST['loginid']);

    $Loginpassword = mysqli_real_escape_string($con,$_POST['loginpassword']);

    $Pinkod = mysqli_real_escape_string($con,$_POST['pin']);

    if( empty($Loginid) || empty($Loginpassword) || empty($Pinkod))

    {

        echo 'Fill all the rows ';

    }

    else

    {

        if($Loginid == $_POST['loginid'] && $Loginpassword == $_POST['loginpassword'] && $Pinkod == $_POST['pin'])

        {

           

            //Delete user with ID

           

            $ID = "SELECT user_number FROM users WHERE loginid = $_POST[loginid]";

            $do = mysqli_query($con,$ID);

Anny help is well aprechiated

May 25, 2023 in Database by Hannes

edited 4 days ago 13 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP