hola cheesegrits lo que quiero hacer es usar el plugin php de un formulario para crear multiples inserciones de datos en una tabla. lo que tengo hoy dia (no en fabrik) es una pagina php con un formulario para ingresar los datos y en una segunda pagina php se ejecuta esta consulta INSERT INTO agenda_act (id_agen,profesional,fech_act,cant_act,us,seg_ing,tar) SELECT '$id_agen' as id_agen,usuarios.NOMBRE, fechas as fech_act, '1' as cant_act, '$us' as us, now() as seg_ing,'$tar' FROM usuarios, fechas,numero WHERE usuarios.NOMBRE= '$prof' and fechas between '$fech_ini' and '$fech_fin' and numero BETWEEN '1' and '$cant' ORDER BY fech_act asc . esta consulta se crea a partir de una tabla con las fechas de los a?os, los numeros para crear la cantidad de registros individuales.
lo que hace es lo siguiente:
1. tengo que crear un registro por cada actividad en cada dia ( una agenda de actividades)
2.A esa actividad asignarle el nombre de la persona que las debe realizar.
se que se puede realizar con un for pero me ha funcionado con esta consulta sin problemas durante mucho tiempo y pues la verdad no pude realizar el for con cada fecha ya que aveces segun la cantidad de actividades se oueden crear dos o mas actividades el mismo dia.
lo que quiero que me explique es como puedo crear un formulario en fabrik que permita ejecutar esa sentencia mysql para insertar los datos. lo que estaba probando lo vi en un post en el foro pero no me funciona, las llaves son los nombres d elos campos y asi funciona para insertar un solo registro.
gracias por su ayuda
Hi cheesegrits what I do is use the php plugin to create multiple form inserts data into a table. what I have today (not fabrik) is a php page with a form to enter data and a second php page executes this query INSERT INTO agenda_act (id_agen, professional, fech_act, cant_act, us, seg_ing, tar) SELECT '$ id_agen' as id_agen, usuarios.NOMBRE, dates as fech_act, '1 'as cant_act,' $ us 'as us, now () as seg_ing,' $ tar 'FROM users, dates, usuarios.NOMBRE WHERE number =' $ prof 'and date between' $ fech_ini 'and' $ fech_fin 'and number BETWEEN '1' and '$ qty' ORDER BY fech_act asc. this query is created from a table with the dates of the years, the numbers to create the number of individual records.
what it does is the following:
1. I have to create a record for each activity in each day (a calendar of activities)
2.A this activity assign the name of the person who must perform.
it can be done with a for but it has worked with this query without problems for a long time and because the truth could not perform for each second date because sometimes the amount of activities oueden create two or more activities the same day .
I want to explain to me is how I can create a form in fabrik enforce that judgment allowing mysql to insert data. what I saw was testing in a post on the forum but it does not work, the keys are the names d elos fields and also works to insert a single record.
thanks for your help