hacer update a un formulario
Publicado por daniel (50 intervenciones) el 23/03/2015 02:34:58
hola a todos los que me lean necesito una gran ayuda ...
tengo una web en php y mysql y quiero hacer actualizaciones de algunos registros
tengo los siguiente para hacerlo pero no me resulta:
------------------------------------------------------------------------------
aqui esta en donde recibo por get los datos del formulario:
----------------------------------------------------
y me manda luego a esta pagina de actualizacion de los datos
---------------------------------------------
la verdad no se que esta mal y ya he hecho de todo para poder arreglarlo
un dato , creo que esta mal la query porque habia encontrado un codigo en internet que me dijo eso....
debo decir que no se mucho de php y mysql...
...bueno, espero que alguien me ayude por favor desde ya muchisimas gracias
tengo una web en php y mysql y quiero hacer actualizaciones de algunos registros
tengo los siguiente para hacerlo pero no me resulta:
------------------------------------------------------------------------------
aqui esta en donde recibo por get los datos del formulario:
1
2
3
4
5
6
7
8
9
10
11
12
<?php
require_once('../../Connections/pelislatino.php');
?>
<?php
//definir database
mysql_select_db($database_pelislatinofinal,$pelislatinofinal) or die ("no se pudo conectar");
?>
<?php
$rst_produtos = mysql_query ("select * from tbltodaslaspelis where idPelicula=".$_GET["editar"].";",$pelislatinofinal);
$fila_producto = mysql_fetch_array($rst_produtos);
?>
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
<form id="form2" name="form2" method="POST" action="proceso_edicion.php?editar=<?php echo $_REQUEST["editar"]; ?>">
<table width="405" border="1">
<tr>
<td>idpelicula</td>
<td><label for="idPelicula"></label>
<input name="idPelicula" type="text" id="idPelicula" value="<?php echo $fila_producto['idPelicula'];?>" /></td>
</tr>
<tr>
<td width="127">Nombre</td>
<td width="262"><label for="Nombre"></label>
<input name="Nombre" type="text" id="Nombre" value=" <?php echo $fila_producto['Nombre'];?>" /></td>
</tr>
<tr>
<td>Imagen</td>
<td><label for="Imagen"></label>
<input type="text" name="Imagen" value="<?php echo $fila_producto['Imagen'];?>" size="25" />
<input type="button" name="button" id="button" value="Subir Imagen" onclick="javascript:subirimagen();"/></td>
</tr>
<tr>
<td>Sinopsis</td>
<td><label for="Sinopsis"></label>
<input name="Sinopsis" type="text" id="Sinopsis" value="<?php echo $fila_producto['Sinopsis'];?>" /></td>
</tr>
<tr>
<td>Info</td>
<td><label for="Info"></label>
<textarea name="Info" id="Info" value="" cols="45" rows="5"><?php echo $fila_producto['Info'];?></textarea></td>
</tr>
<tr>
<td>Peli Online</td>
<td><label for="Online"></label>
<input name="Online" type="text" id="Online" value=<?php echo $fila_producto['Online'];?>" /></td>
</tr>
<tr>
<td>Trailer</td>
<td><label for="Trailer"></label>
<input name="Trailer" type="text" id="Trailer" value="<?php echo $fila_producto['Trailer'];?>" /></td>
</tr>
<tr>
<td>Links</td>
<td><label for="Links"></label>
<textarea name="Links" id="Links" cols="45" rows="5"><?php echo $fila_producto['Links'];?></textarea></td>
</tr>
<tr>
<td>Tags</td>
<td><label for="Tags"></label>
<textarea name="Tags" id="Tags" cols="45" rows="5"><?php echo $fila_producto['Tags'];?></textarea></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="agendar" id="agendar" value="Editar" /></td>
</table>
</form>
----------------------------------------------------
y me manda luego a esta pagina de actualizacion de los datos
1
2
3
4
5
6
7
8
9
<?php
require_once('../../Connections/pelislatino.php');
//definir database
mysql_select_db($database_pelislatinofinal,$pelislatinofinal) or die ("no se pudo conectar");
?>
<?php
$sql = mysql_query("UPDATE tbltodaslaspelis SET idPelicula=".$_POST["idPelicula"].", Nombre=".$_POST["Nombre"].", Imagen=".$_POST["Imagen"].", Sinopsis=".$_POST["Sinopsis"].", Info=".$_POST["Info"].", Online=".$_POST["Online"].", Trailer=".$_POST["Trailer"].", Links=".$_POST["Links"].", Tags=".$_POST["Tags"]."' WHERE idPelicula=".$_REQUEST["editar"].";",$pelislatinofinal);
?>
---------------------------------------------
la verdad no se que esta mal y ya he hecho de todo para poder arreglarlo
un dato , creo que esta mal la query porque habia encontrado un codigo en internet que me dijo eso....
debo decir que no se mucho de php y mysql...
...bueno, espero que alguien me ayude por favor desde ya muchisimas gracias
Valora esta pregunta
0