Ver Mensaje Individual
  #5 (permalink)  
Antiguo 13/04/2010, 12:53
luydjmix
 
Fecha de Ingreso: junio-2009
Mensajes: 14
Antigüedad: 14 años, 10 meses
Puntos: 0
Respuesta: Error // no envia los datos

pos ya le pose el or y le agre lo que me aconsejaron y me genera este error // lo que en tiendo es que hay un eror en la linea 7 de el codigo de incert y que no selecciono la base de datos //pero lo mismo que les mostre, el mismo codigo de sql para la base.


Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in C:\wamp\www\Nueva carpeta\incert.php on line 7
Error al seleccionar la Base de Datos: Access denied for user 'SYSTEM'@'localhost' (using password: NO)

// hasi quedo despues de modificar




<!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=utf-8" />
<title>Documento sin título</title>
</head>

<body>
<table width="521" height="193" border="1">
<tr>
<td><form id="form1" name="form1" method="post" action="incert.php">
<table width="512" height="189" border="1">
<tr>
<td><label>
<input type="text" name="a" id="a" />
</label></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><label>
<input type="text" name="b" id="b" />
</label></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><label>
<input type="submit" name="incertar" id="incertar" value="Enviar" />
</label></td>
<td>&nbsp;</td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>



codigo incert.php:



<?php
$conexion=new mysqli("localhost","root","");
if (mysqli_connect_error()){
printf("error de coneccion;\n",mysqli_connect_error());
exit();
}
mysql_select_db('FORMA')or die ('Error al seleccionar la Base de Datos: '.mysql_error());

$a=$_POST['a'];
$b=$_POST['b'];
$sql_query="insert into mas(campo1,campo2) values('$a','$b')";
$result=mysql_query($sql_query);
header("location: pro.php");
?>



codigo sql:


CREATE DATABASE `forma` ;
CREATE TABLE `forma`.`mas` (
`a` TEXT NOT NULL ,
`b` TEXT NOT NULL
) ENGINE = MYISAM ;

ya hise lo que me digeron pero no da solucion porfa probar // estoy usando wampserver 2.0// como simulador// tambien pienso que debo usar un pasword pero yo ya habia probado coneciones sin pasword y me conectaba sin problema

Última edición por luydjmix; 13/04/2010 a las 13:01