Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/07/2014, 11:09
portal47
 
Fecha de Ingreso: abril-2014
Mensajes: 141
Antigüedad: 10 años
Puntos: 1
Respuesta: ingresar registros

esta es la conexion

Código PHP:
Ver original
  1. <html>
  2. <head>
  3. <title>Actualización</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. </head>
  6. <body>
  7.  
  8.  
  9. <?php
  10. function connectToDB( $dbName="" ) {
  11.    
  12.     $hostdb = 'localhost';  
  13.     $userdb = 'root';  
  14.     $passdb = 'root';    
  15.     $namedb =  $dbName ? $dbName : 'movedb';
  16.  
  17.     $link = mysql_connect ($hostdb, $userdb, $passdb);
  18.        
  19.     if (!$link) {
  20.        die('Could not connect: ' . mysql_error());
  21.     }
  22.  
  23.     $db_selected = mysql_select_db($namedb);
  24.     if (!$db_selected) {
  25.         die ('Can\'t use database : ' . mysql_error());
  26.     }
  27.     return $link;
  28. }
  29.  
  30. ?>
  31.  
  32.  
  33. </body>
  34. </html>

no entendi eso VALUES como numeros, como los hago que sean texto?

en los formularios tengo algo asi para cada registro

Código HTML:
Ver original
  1. <li>  
  2.                     <label for="name">Nombre:</label>  
  3.                     <input type="text" name="nombre" required />  
  4.                 </li>

seria asi?
Código PHP:
Ver original
  1. $registro3=mysql_query("INSERT INTO dir_puesto (id_puesto, puesto) VALUES ($id_puesto, $puesto)");