sql - PhP Select not sending value -
<?php include ("forms/coneccao_feed.php"); $query = "select id id, nome nome provedor"; $query1= "select max(id) id provedor"; $ultprovedor = mysqli_query ($ligacao_feed, $query1); $ultimo_provedor = mysqli_fetch_row($ultprovedor); $provedores = mysqli_query($ligacao_feed, $query); ?> <select name="provedor"> <?php while($provedor=mysqli_fetch_array($provedores)){ if ($provedor['id'] == $ultimo_provedor['0']){ ?> <option value="<?php echo $provedor['id']; ?>" selected><?php echo $provedor['nome'] ?></option> <?php }else{ ?> <option value="<?php echo $provedor['id']; ?>"><?php echo $provedor['nome'] ?></option> <?php } }?> </select>
i searched everywhere cant find answer, when submit not send anything, , tried echo in form nothing.
<?php include ("forms/coneccao_feed.php"); $id_provedor = $_post['id']; $mensagem = $_post['msg']; $query = "select nome nome provedor id='".$id_provedor."'"; echo $query; echo "<br>".$mensagem."<br>".$id_provedor; //$res_query = ($ligacao_feed, $query); ?>
your select
name
provedor
, using id
in $_post
assignment:
$id_provedor = $_post['id'];
should be
$id_provedor = $_post['provedor'];
Comments
Post a Comment