-1
How could I store the ID
of each record, and the ID_PESSOAS
by going through the while ($exibe = mysqli_fetch_assoc($dados)
so that in the future the user click on the "see vacancies" button I know which of the records brought by select
was clicked by the user, and then I can take it to another page with all the data pertaining to the row of the registry in question in Mysql.
I’ll leave the essensial code part for understanding below
Selecting data from the database
session_start();
include('../conexao.php');
$redirecionar = $_SESSION['email'];
$consulta = "SELECT * FROM vagas_emprego
LEFT JOIN pessoas ON `ID_PESSOAS` = `PESSOAS_ID_PESSOAS`
WHERE `status` = 'O' AND `ramo` = 'Produção'
UNION ALL
SELECT * FROM habilidades_candidatos
LEFT JOIN pessoas ON `ID_PESSOAS` = `PESSOAS_ID_PESSOAS`
WHERE `status` = 'O'AND `ramo` = 'Produção'";
$dados = mysqli_query($CONN, $consulta);
$row = mysqli_num_rows($dados);
Displaying the data
<div class="col-md-10 ml-auto mr-auto"><br>
<?php while ($exibe = mysqli_fetch_assoc($dados)) { ?>
<div class="card border-dark mb-3">
<div class="card-header">
Produção | Portal de Empregos
</div>
<div class="md-form">
<h4 class="card-title"><?php echo " " . $exibe["TITULO_VAGA"] . " | " . $exibe["ID_VAGAS_EMPREGO"]; ?></h4>
<textarea readonly style="background-color: white; resize: none" id="form7" class="md-textarea form-control" rows="10"> <?php echo $exibe["DESCRICAO_VAGA"]; ?></textarea>
</div>
<div class="card-footer">
<center><a href="#" class="btn btn-primary">Ver Vaga</a></center>
</div>
</div>
<?php }
In the element
<a>
you enter the URL of the other page; just pass the id value through the query string, leaving something like/exibir.php?id=1
– Woss
your
SELECT
wouldn’t that be so? SELECT * FROM Vacancies LEFT JOIN People ONvagas_emprego
.ID_PESSOAS =pessoas
.PESSOAS_ID_PESSOAS WHEREstatus
= 'O' ANDramo
= 'Production– goio