mysql php
Publicado por emmanuel (2 intervenciones) el 03/05/2017 22:15:51
tengo el siguiente codigo. pero a la hora de darlo de alra a la base de datos, mi id_inv es foranea, pero no se registra en la base de datos...
id_inv viene de una tabla que tiene registros,
pero para programar o calanderisar no se da de alta en mi base!
no se si me explique bien
id_inv viene de una tabla que tiene registros,
pero para programar o calanderisar no se da de alta en mi base!
no se si me explique bien
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
<!DOCTYPE html PUBLIC >
<html>
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>PROGRAMAR</title>
<!-- link calendar resources -->
<link rel="stylesheet" type="text/css" href="tcal.css" />
<script type="text/javascript" src="tcal.js"></script>
</head>
<body>
<?php
include "Conectar.php";
$inve=($_GET[' id_inv ']);
?>
<center>
<form action = "" method = "POST">
No. id<br><input type="text" name="valu" value=""<br>
<!--No Inventario<br><input type="text" name="inve" value= "<?php echo $inve ?>"><br>-->
<!-- clase calendario -->
<h3>seleccione fecha de inicio</h3>
<input type="text" name="inicio" class="tcal" value="" /><br>
<h3>seleccione fecha de final</h3>
<div><input type="text" name="final" class="tcal" value="" /></div><br>
<br>
<h3>Elige el Periodo Escolar</h3>
<select name = "tip"/>
<option value="correctivo">ENERO-JUNIO </option>
<option value="preventivo">AGOSTO-DICIEMBRE</option>
</select><br><br>
<h3>Comentario<h3>
<p><textarea name="comentario" rows="5" cols="50">Escribe aquí tu comentario: </textarea></p><br>
<input type="submit" value = "ENVIAR" /><br>
</form><br>
<?php
if ($_POST){ //si se presiona aceptar
$a=$_POST['valu'];
$na=$_POST['inicio'];
$t=$_POST['final'];
$d=$_POST['tip'];
$p=$_POST['comentario'];
mysql_query("INSERT INTO programacion(a,f_inicio,f_final,periodo,var1)
values ('$id','$na','$t','$d','$p')");
echo "<h2>DATO GUARDADO</h2>";
}
?>
<a href="calibrado.php">regresar</a><br>
<a href="principal.php">inicio</a><br>
</center>
</body>
</html>
Valora esta pregunta


0