Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/03/2014, 15:13
rascabuchitos
 
Fecha de Ingreso: abril-2011
Ubicación: Peru
Mensajes: 486
Antigüedad: 13 años, 1 mes
Puntos: 9
mysql a mysqli

hola amigos
tengo esto

Código PHP:
Ver original
  1. <?php
  2. $state = false;
  3. if ($_POST['action'] == "add") {
  4.     $conexion = mysql_connect("localhost", "usuario", "clave");
  5.     mysql_select_db("demo", $conexion);
  6.    
  7.     $que = "INSERT INTO empresa (nombre, direccion, telefono) ";
  8.     $que.= "VALUES ('".$_POST['nombre']."', '".$_POST['dir']."', '".$_POST['fono']."') ";
  9.     $res = mysql_query($que, $conexion) or die(mysql_error());
  10.     $state = true;
  11. }
  12. ?>
  13. </head>
  14. <body>
  15. <h2>Insertar datos en MySQL</h2>
  16. <form id="insertar" name="insertar" method="post" action="">
  17.   <p>Nombre:
  18.     <input name="nombre" type="text" id="nombre" size="50" />
  19.   </p>
  20.   <input type="submit" name="Submit" value="Insertar Registro" />
  21.   <input type="hidden" name="action" value="add" />
  22. </form>
  23. <?php if ($state) { ?>
  24. <p><em>Registro insertado correctamente</em></p>
  25. <?php } ?>
  26. </body>
  27. </html>


alguien puede recomendarme algun manual para evolucionar de mysql a mysqli?


gracias...!!!!