¿Por qué este SELECT no muestra nada?
Publicado por Juan Manuel (18 intervenciones) el 27/11/2015 00:29:46
Tengo un select, que extrae los nombres de una tabla y los muestra en el select, al darle al botón "Enviar", no me muestra los datos del select que hay en otra tabla...
¿En que me estoy equivocando? Llevo una semana toqueteando el código y nada, sigo estancadísimo en esto...
Alguna ayuda?
¿En que me estoy equivocando? Llevo una semana toqueteando el código y nada, sigo estancadísimo en esto...
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<html>
<head><title>Partidos arbitrados</title></head>
<body>
<form method="POST" action="#">
<?php
$link= mysqli_connect("localhost", "root", "", "proyecto") or die ("Error de conexion: ".mysqli_connect_error());
$consulta_mysql='Select nombre, apellido_1, apellido_2 from arbitros';
$nombre=mysqli_query($link, $consulta_mysql);
$result = $link->query($consulta_mysql);
?>
<select>
<?php
while ($row =$result->fetch_array())
{
?>
<option value="<?php echo $row['apellido_1']." ".$row['apellido_2'].", ".$row['nombre']?> ">
<?php echo $row['apellido_1']." ".$row['apellido_2'].", ".$row['nombre']; ?>
</option>
<?php
}
?>
</select>
<input type="submit" value="enviar"/>
<?php
$link= mysqli_connect("localhost", "root", "", "proyecto") or die ("Error de conexion: ".mysqli_connect_error());
$consulta_mysql1='Select * from asignaciones where arbitro="'.$row["apellido_1"].$row["apellido_2"].", ".$row["nombre"].'" or asistente1="'.$row["apellido_1"].$row["apellido_2"].", ".$row["nombre"].'" or asistente2="'.$row["apellido_1"].$row["apellido_2"].", ".$row["nombre"].'"';
$nombre=mysqli_query($link, $consulta_mysql1);
$resulta = $link->query($consulta_mysql1);
while ($row = mysqli_fetch_row($resulta)) {
echo $row['arbitro'];
echo $row['asistente1'];
echo $row['aistente2'];
echo $row['categoria'];
echo $row['local'];
echo $row['visitante'];
echo $row['fecha'];
echo $row['hora'];
echo $row['campo'];
echo $row['jornada'];
}
?>
<option value="<?php echo $row['apellido_1']." ".$row['apellido_2'].", ".$row['nombre']?> ">
<?php echo $row['apellido_1']." ".$row[ 'apellido_2'].", ".$row['nombre']; ?>
</option>
<table border="2">
<tr>
<th>arbitro</th>
<th>asistente1</th>
<th>asistente2</th>
<th>categoria</th>
<th>Local</th>
<th>visitante</th>
<th>Fecha</th>
<th>Hora</th>
<th>campo</th>
<th>jornada</th>
</tr>
<?php while ($row = mysqli_fetch_assoc($resulta)){ ?>
$contador++;
<tr>
<td><?php echo $row['arbitro']; ?></td>
<td><?php echo $row['asistente1']; ?></td>
<td><?php echo $row['asistente2']; ?></td>
<td><?php echo $row['categoria']; ?></td>
<td><?php echo $row['local']; ?></td>
<td><?php echo $row['visitante']; ?></td>
<td><?php echo $row['fecha']; ?></td>
<td><?php echo $row['hora']; ?></td>
<td><?php echo $row['campo']; ?></td>
<td><?php echo $row['jornada']; ?></td>
</tr>
<?php } ?>
</table>
<input type="submit" value="volver" onclick="this.form.action='calcurefhome.html'"/>
<!--</form>-->
</body>
</html>
Alguna ayuda?
Valora esta pregunta
0