Ayuda, siempre me da el mismo resultado.
Publicado por Jesus (2 intervenciones) el 24/07/2014 10:30:10
Buen dia, tengo el siguiente código, y quiero que la variable del Destino que la selecciono en el primer query se me almacene en otra base de datos para otros propósitos y lo que pasa es que siempre me da el mismo resultado no cambia a otra variable. La verdad no se que estoy haciendo mal y me esta volviendo loco. De antemano gracias por la ayuda.
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
<html>
<head>
<title>VER PRECIOS DE DESTINOS</title>
<style>
table,th,td
{
font-family: Tahoma;
border:1px solid black;
border-collapse:collapse;
}
th,td
{
padding:5px;
}
th
{
text-align:left;
}
</style>
</head>
<body>
<span style="font-family: Tahoma; font-size: 45.0px; font-weight: bold; ">
VER PRECIOS DE DESTINOS
</span>
<br>
</br>
<br>
</br>
<form action="editdest.php" method="post">
<table style="width:300px">
<?php
mysql_connect("localhost", "root", "Kpirosho1984!@") or die(mysql_error());
mysql_select_db("Destinos") or die(mysql_error());
$order = "SELECT * FROM Destinos ORDER BY Destino";
$result = mysql_query($order);
?>
<table style="width:300px">
<tr>
<th>DESTINO</th>
<th>PRECIO</th>
<th>EDICION</th>
</tr>
<?php while($data = mysql_fetch_row($result)){
$editdes = $data[0];
mysql_select_db("var") or die(mysql_error());
mysql_query("TRUNCATE TABLE var");
mysql_query("INSERT INTO `var`.`var` (`variable`) VALUES ('$editdes')");
?>
<tr>
<td> <?=$data[0]?> </td>
<td> $<?=$data[1]?> </td>
<td> <input type="submit" name="editdes" value="EDITAR" /></td>
</tr> <?php
}
?>
</table>
</form>
</body>
</html>
Valora esta pregunta
0