PHP - insertar datos en un select

 
Vista:

insertar datos en un select

Publicado por jg (2 intervenciones) el 01/04/2017 06:48:44
hola quisiera saber como modificar esta linea para que me funcione no me reconoce, la parte del SELECT


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<table class="table bootstrap-datatable countries">
  <thead>
    <tr>
      <th>Nombre Proyecto</th>
      <th>objetivo General</th>
      <th>Objetivo Especifico 1/2</th>
      <th>Objetivo Especifico 2/2</th>
      <th>Planteamiento</th>
      <th>Evaluador</th>
 
 
    </tr>
  </thead>
  <tbody>
    <?php
      $re=mysql_query("select * from proyecto");
      $h =
      '
      ?>
      <form action='sf.php' method='post'>
        <select>

          $m = "h";
          <option value='volvo'>Volvo</option>




        </select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <button type='submit'>Entrar</button>
      </form>
      ';
 
 
      while ($f=mysql_fetch_array($re))
      {
          echo '<tr>
            <td>'.$f['namepro'].'</td>
            <td>'.$f['obje_gene'].'</td>
            <td>'.$f['obje_espe'].'</td>
            <td>'.$f['obje_especi'].'</td>
            <td>'.$f['planteamiento'].'</td>
            <td>'.$h.'</td>


            </tr>';
      }
 
 
    ?>
 
  </tbody>
</table>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de xve
Val: 3.943
Oro
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

insertar datos en un select

Publicado por xve (6935 intervenciones) el 02/04/2017 08:41:39
Hola Jg, si abre una cadena con comillas simples, no puedes volver a utilizar las comillas simples en su interior, ya que dara error. Tampoco puedes definir variables dentro de las comillas, ya que no funcionara!!!

Prueba a poner la linea así:
1
2
3
4
5
6
$h ='<form action="sf.php" method="post">
        <select>
           <option value="volvo">Volvo</option>
        </select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="submit">Entrar</button>
      </form>';
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar