$mysqli = new mysqli(); $query = "INSERT INTO tableName(column1,column2) SELECT (column1,column2) FROM tableName"; $result = $mysqli->query($query);