Created
October 13, 2018 03:27
-
-
Save vidux/a5e0318f8457d483d3afd4379d116164 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Move A row to another same-field talbe php | |
table:Foo | |
+------------+ | |
|id|name|age | | |
+------------+ | |
|2|Vidx| 24 | | |
+------------+ | |
table:bar | |
+------------+ | |
|id|name|age | | |
+------------+ | |
<?php | |
$sql="INSERT INTO bar SELECT * FROM Foo WHERE id = '2'"; | |
if (mysqli_query($conn, $sql)) { | |
mysqli_query($conn, "DELETE FROM Foo WHERE id = '2'"); | |
} else { | |
echo "error"; | |
} | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment