I have 2 tables account1 and account2
account1 with the columns [account_code1] and [account_name1]
account2 with the columns [account_code2] and [account_name2]
I need your help to show the data of account1 and account2 in the select
here the code:
<?php
if(!isset($conexion)){
include ("conexion.php");
}
$query = "SELECT codigo_cuenta1, nombre_cuenta1 FROM cuenta1 ";
$resultado = $conexion->query($query);
?>
<div class="row">
<div class="col-lg-6">
<label for="cbx_cuenta1" class="control-label">Seleccionar Cuenta1</label>
<select name="cbx_cuenta1" id="cbx_cuenta1" class="form-control" required title="Debe seleccionar una cuenta">
<option value="">Seleccionar</option>
<?php while($row = $resultado->fetch_assoc()) { ?>
<option value="<?php echo $row['codigo_cuenta1']; ?>"><?php echo $row["codigo_cuenta1"] .". ". utf8_encode($row["nombre_cuenta1"]); ?></option>
<?php } ?>