I need to show the data entered by a user in a modal, which has a data select
and enter an amount, these data must be shown in a table after being saved in DB
When saving them, the error I get is:
Warning: mysql_query () expects parameter 1 to be string, object given in ....
<table class="table table-bordered">
<thead>
<tr> <th>Código</th>
<th>Descripción del Gasto</th>
<th width="150" height="45"> Monto Generado</th>
<th width="150" height="45">Pago por Apartamento</th> <th width="120" height="45">Opciones</th>
</tr>
</thead>
<?php
$sql = "SELECT * FROM gasto_g";
$consulta = mysql_query($conexion,$sql);
if($consulta>0){
while($resultado = mysql_fetch_array($consulta)){
?>
<tr>
<td><?php echo $resultado['id_gasto_g']; ?></td>
<td><?php echo $resultado['descripcion']; ?> </td>
<td width="7" height="7"><?php echo $resultado['monto']; ?> </td>
<td> </td>
<td> <!--Boton agregar -->
<div class="col-md-1 col-md-offset-0">
<button class="btn btn-primary btn-sm" id="sesion" data-toggle="modal" data-target="#registro" rel="tooltip-left" title="Editar">
<i class="fa fa-pencil"></i>
</button>
</div>
</div><br>
<!--Boton agregar --> </td>
</tr>
<?php
}
?>
</tbody>
<?php
}
?>
</table>
</div>
</div>
</div><!--/content-body -->
</div><!--/content -->