php - Insert in one table and delete from another simultaneously

$i=mysql_query("insert into members_data values(NULL,'".$name."','".$fathers_name."','".$gotra."','".$image."','".$village."','".$company_name."','".$address1."','".$address2."','".$city."','".$pincode."','".$mobile1."','".$mobile2."','".$village_number."')");

$res=mysql_query("SELECT image FROM temp_members_data WHERE 'image' = '$image'");
mysql_query("DELETE FROM temp_members_data WHERE 'image' = '$image'");


<script type="text/javascript">window.location="admin_approve.php"</script>

I need help in inserting in one table and deleting from another table by clicking just add button. Its like adding in main table and deleting from the temp table. Please Help




"You must have 50 reputation to comment" >.<

Are you wanting to move this data from one table to another table? From on database to another database? You need to clarify a little bit more on what you are trying to do. Do you have some kind of primary key that you use instead of using an image? (or rather image patch). From my understanding you want to move it from one table to another. If this is the case: Do you NEED to delete that data intemp_members_data or would that just be something that would be nice to have? If it's the latter, then try this:

INSERT INTO new_members_data SELECT * FROM old_members_data WHERE image = '$image'"

People are also looking for solutions to the problem: php - How to get full html content of specific url?


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.