This topic is locked

Send email with new data values question

9/26/2020 2:22:45 AM
PHPRunner General questions
A
alfonso authorDevClub member

Hello. Everything works correctly and sends email with all the data. The problem is that I have a table related to the states and in the email I want to send the name of the state, not the id_state which is the value that is stored in the table.

I have tried using their aliases and other forms, but can't.

I have this in the query:
SELECT

formulario_empresas.empresa_id,

formulario_empresas.provincia_fiscal,

formulario_empresas.tipo_socio_club,

provincias.provincia,

tipo_socio.nombre

FROM formulario_empresas

LEFT OUTER JOIN provincias ON formulario_empresas.provincia_fiscal = provincias.id_provincia

LEFT OUTER JOIN tipo_socio ON formulario_empresas.tipo_socio_club = tipo_socio.tipo_id
And then in the email I try to show the data with this:

$message .= "<tr><td><strong>PROVINCE:</strong> </td><td>" . $values["provincias.provincia"] . "</td></tr>";

$message .= "<tr><td><strong>TIPO:</strong> </td><td>" . $values["tipo_socio"] . "</td></tr>";
I try to put this code in Before record added and also in After record added
I also try with alias

SELECT

formulario_empresas.empresa_id,

formulario_empresas.provincia_fiscal,

formulario_empresas.tipo_socio_club,

provincias.provincia AS prov,

tipo_socio.nombre AS soc

FROM formulario_empresas

LEFT OUTER JOIN provincias ON formulario_empresas.provincia_fiscal = provincias.id_provincia

LEFT OUTER JOIN tipo_socio ON formulario_empresas.tipo_socio_club = tipo_socio.tipo_id
And then in the email I try to show the data with this:

$message .= "<tr><td><strong>PROVINCE:</strong> </td><td>" . $values["prov"] . "</td></tr>";

$message .= "<tr><td><strong>TIPO:</strong> </td><td>" . $values["soc"] . "</td></tr>";
Any idea?

Tranks