1

I want to insert data in multiple table

I have two tables > recharge, due_user

recharge table has

>> ID - MOBno-  AMount - Network

due_user has

>> ID - userID - MOBno - Amount - NETWORK

in my form I have checkbox which will ask userID only if I click checkbox.

now insertion of data procedure would be .

if unchecked

 data > ID - mobno - Amount- Network 

will be inserted in Recharging table if checked

 data > ID-  userID -  mobile - amount - Network 

will go both table Recharge and Due_user table but user id will we goes into only due usertable

1 Answer 1

1

Let's say your checkbox looks like this

<input type="checkbox" name="isUserId" />

Then in php

<?php
    //here goes your recharge table insert
    if(isset($_POST['isUserId'])){
        //and here due user table insert
    }
?>
Sign up to request clarification or add additional context in comments.

1 Comment

i want to insert data in both tabe .. in recharge list without userid and in due user list with user id

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.