I have the table that registers a user (gr_entidade) and that has a connection with a user status table (gr_entidade_status). I want the edit form (editing_user.php) to display the value in the database, but I can see the other items in the table (gr_entity_status) so I can edit it.
Note: The connection to the database and method post is working perfectly.
Below is the select that picks up the user to display his information
$sql = " SELECT * FROM gr_entidade ent
JOIN gr_entidade_status status on ent.id_entidade_status = status.id_entidade_status
JOIN gr_entidade_tipo tipo on ent.id_entidade_tipo = tipo.id_entidade_tipo WHERE id_entidade = " . $_GET['id'];
$conn = mysql_query($sql);
$usuario = mysql_fetch_array($conn);
Then the $ user variable along with the field that I define, shows the value that is in the database. In case for this code it would be value ='<?php echo $usuario ['id_entidade_tipo'] ?>'
Below is the status field. In that case, I made a select exclusively in the status table (gr_entity_status) to give me the status value
<label class="control-label">*Staus</label>
<select class="form-control" name="id_entidade_status">
<?php
$result = mysql_query("SELECT * FROM gr_processo_status");
while ($row = mysql_fetch_array($result)) {
?>
<option value="<?php echo $row['id_status_processo']?>"> <?php echo $row['status']?></option>
<?php
}
?>
</select>
I would like to know how I can do to run correctly