Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/01/2010, 21:50
Avatar de shadowjhac
shadowjhac
 
Fecha de Ingreso: diciembre-2009
Ubicación: Peru
Mensajes: 27
Antigüedad: 14 años, 5 meses
Puntos: 0
no agrega nada a mi BD

holas... estoy de vuelta aprendiendo mas sobre php =)

ahora tengo un pequeño problema.

hice unos archivos en php y tmb una bd trato de agregar registros pero todo m agrega en blanco, no se exactamente cual es el error, podrian ayudarme por favor??

aqui esta el codigo
seleccionar.php
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<
title>SELECCIONE RUTA</title>
<
style type="text/css">
<!--
body {
    
background-color#0033FF;
}
-->
</
style></head>

<
body>
<
div align="center">
  <
table width="1006" height="209" border="0" align="center">
    <
tr>
      <
th colspan="5" bordercolor="#000000" scope="col"><object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,0,0" width="512" height="150">
          <
param name="src" value="imagen/TRANSPORTE.swf" />
          <
embed src="imagen/TRANSPORTE.swf" pluginspage="http://www.macromedia.com/shockwave/download/" width="512" height="150"></embed>
        </
object></th>
    </
tr>
    <
tr>
      <
th colspan="5" bordercolor="#000000">        <h1>SISTEMA DE CONTROL DE PASAJES </h1></th>
    </
tr>
    <
tr>
      <
th width="162" bordercolor="#000000">        <h3><strong><a href="index.php">INICIO</a></strong></h3></th>
      <
th width="252" bordercolor="#000000">        <h3><strong><a href="seleccionar.php">SELECCIONAR SERVICIO</a> </strong></h3></th>
      <
th width="179" bordercolor="#000000">        <h3><strong><a href="listar.php">LISTAR</a></strong></h3></th>
      <
th width="204" bordercolor="#000000">        <h3><strong><a href="borrar.php">BORRAR</a></strong></h3></th>
      <
th width="187" bordercolor="#000000">        <h3><strong><a href="contactenos.php">CONTACTENOS</a></strong></h3></th>
    </
tr>
    <
tr>
      <
td colspan="5"><div align="center">
        <
p>&nbsp;</p>
        <
p>&nbsp;</p>
        <
table width="1052" height="94" border="1" align="center">
  <
tr>
    <
td width="160" height="50" bgcolor="#00CCFF"><div align="center"><strong>FECHA DE VIAJE </strong></div></td>
    <
td width="148" bgcolor="#00CCFF"><div align="center"><strong>RUTA</strong></div></td>
    <
td width="144" bgcolor="#00CCFF"><div align="center"><strong>AGENCIA</strong></div></td>
    <
td width="144" bgcolor="#00CCFF"><div align="center"><strong>SALIDA</strong></div></td>
    <
td width="150" bgcolor="#00CCFF"><div align="center"><strong>Nro ASIENTO </strong></div></td>
    <
td width="146" bgcolor="#00CCFF"><div align="center"><strong>Nro PISO </strong></div></td>
    <
td width="257" bgcolor="#00CCFF"><div align="center"><strong>COSTO S/. </strong></div></td>
  </
tr>
  <
tr>

    <
td height="36"><div align="center">
            <
input type="date" name="fecha" />
 </
div></td>
   <
td>
      <
p align="center">
        <
input type="text" name="ruta" />
    <
td><p align="center">
  <
input type="text" name="agencia" />
    <
td>
     <
p align="center">
        <
input type="text" name="salida" />
    <
td> <div align="center">
      <
input type="text" name="asiento" />   
    </
div>
    <
td> <div align="center">
      <
input type="text" name="piso" />   
    </
div>
    <
td>
      <
p align="center">
        <
input type="text" name="costo" />
        </
tr>
</
table>
<
div align="center"><br>
<
form action="seleccionar2.php" method="post">

  <
input name="submit" type="submit" value="A&ntilde;adir" />
  </
form>
</
div>
  
      <
div align="center"></div>      <div align="center"></div></td>
    </
tr>
  </
table>
  
</
div>
</
body>
</
html
y aqui el php al cual hizo el llamado seleccionar2.php

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>SELECCIONE RUTA</title>
<style type="text/css">
<!--
body {
    background-color: #0033FF;
}
-->
</style></head>

<body>
<div align="center">
  <table width="1006" height="209" border="0" align="center">
    <tr>
      <th colspan="5" bordercolor="#000000" scope="col"><object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,0,0" width="512" height="150">
          <param name="src" value="imagen/TRANSPORTE.swf" />
          <embed src="imagen/TRANSPORTE.swf" pluginspage="http://www.macromedia.com/shockwave/download/" width="512" height="150"></embed>
        </object></th>
    </tr>
    <tr>
      <th colspan="5" bordercolor="#000000">        <h1>SISTEMA DE CONTROL DE PASAJES </h1></th>
    </tr>
    <tr>
      <th width="162" bordercolor="#000000">        <h3><strong><a href="index.php">INICIO</a></strong></h3></th>
      <th width="252" bordercolor="#000000">        <h3><strong><a href="seleccionar.php">SELECCIONAR SERVICIO</a> </strong></h3></th>
      <th width="179" bordercolor="#000000">        <h3><strong><a href="listar.php">LISTAR</a></strong></h3></th>
      <th width="204" bordercolor="#000000">        <h3><strong><a href="borrar.php">BORRAR</a></strong></h3></th>
      <th width="187" bordercolor="#000000">        <h3><strong><a href="contactenos.php">CONTACTENOS</a></strong></h3></th>
    </tr>
    <tr>
      <td colspan="5"><div align="center">
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <?php
$conexion
=mysql_connect("localhost","root","admin") or die("Problemas en
la conexion"
);
mysql_select_db("sistema",$conexion) or die("Problemas en la seleccion
de la base de datos"
);
mysql_query("insert into control(fecha, ruta, agencia, salida, asiento, piso, costo) values
('$_POST[fecha]','$_POST[ruta]','$_POST[agencia]','$_POST[salida]','$_POST[asiento]''$_POST[piso]''$_POST[costo]')"
,
$conexion) or die("Problemas en el select".mysql_error());
mysql_close($conexion);
echo 
"Los datos han sido introducidos en la base de datos";
?>
        <div align="center"><br>

</div>
      </div>        <div align="center"></div>        <div align="center"></div>        <div align="center"></div>        <div align="center"></div>
      <div align="center"></div>      <div align="center"></div></td>
    </tr>
  </table>
  
</div>
</body>
</html>
PD. mi base de datos se llama SISTEMA, mi tabla CONTROL
mis campos son:

id, fecha, ruta, agencia, salida, asiento, piso, costo

todos son varchar (30) excepto id ="INT"(11) y fecha = "DATE" (11)

q puede estar mal? una ayudita para poder seguir aprendiendo por favor...