insert values in a table with a select

0

How do I insert values in the database?

This is a query, it relates several tables, but I need that data to be stored in the MySQL database

This is the table I'm doing in PHP

echo '<table id="TablaColor" border="1" width="100%">
                <tr id="TituloRojo">
                    <td colspan="8">Incumplimiento del Horario</td>
                </tr>
                <tr id="TituloVerde">
                    <td colspan="1" width="100">Profesor</td>
                    <td colspan="1">Curso</td>
                    <td colspan="1">Día <br> evaluación</td>
                    <td colspan="1">Error <br> Nota</td>
                    <td colspan="1">Error <br> Trabajo</td>
                    <td colspan="1">Horario Entrada</td>
                    <td colspan="1">Tiempo de entrega</td>
                    <td colspan="1">Anotaciones</td>
                </tr>
                <tr>
                    <td colspan="1">'.$Nombre.'</td>
                    <td colspan="1">'.$curso.'</td>
                    <td colspan="1">'.$Dia.'</td>
                    <td colspan="1" id="TituloClaro">'.$Nota.'</td>
                    <td colspan="1" id="TituloClaro">'.$Trabajo.'</td>
                    <td colspan="1">'.$Entrada.'</td>
                    <td colspan="1">'.$Tiempo.'</td>
                    <td colspan="1">'.$Anotaciones.'</td>

                 </tr>
      </table>';

MUST THE INSERT GO BEFORE OR AFTER THE TABLE?

    
asked by FOX 11.08.2017 в 21:43
source

1 answer

1

the solution is a insert/select I will post a small example:

insert into tabla_replica (id_tabla1,nombre,apellido)
select id_tabla1,
       nombre,
       apellido
  from tabla1
  where id_tabla1 > 1;

to see the full functionality I invite you to see this link

    
answered by 11.08.2017 / 22:13
source