Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/10/2012, 08:43
feuerwehr189
 
Fecha de Ingreso: abril-2011
Mensajes: 18
Antigüedad: 13 años
Puntos: 0
No puedo conectar php con mysql

holas como sale arriba tengo ese probema que es muy básico pero no se la verdad que hacer espero y me puedan ayudar, tengo:

apache 2.2.22
mysql 5.5.24
php 5.4.3

todo instado por wampserver 2.2


el formulario es

<html>
<head>
<title>Page Title</title>
</head>
<body>
<form method="post" action="prueba2.php">

nombre<br>
<input type="text" name="campo1" id="1">
<input type="submit" name="Guardar">

</form>
</body>
</html>

el cual envio al archivo php que sigue

<?php
$nombre=$_POST['campo1'];

$conexion=mysql_connect("localhost","root","");
mysql_select_db("informe");

mysql_query("insert into cliente (nombre) values ('$nombre')");

<h1><div align="center">Registro Insertado</div></h1>

$resultado=mysql_query("select nombre from cliente");

echo "tu nombre es: ".$resultado['nombre'];

?>

y que cuando ejecuto el html me sale esto en pantalla

Registro Insertado
$resultado=mysql_query("select nombre from cliente"); echo "tu nombre es: ".$resultado['nombre']; ?>


PORFAVOR AYUDENME ESTOY MUY ESTRESADO PORQUE A MI ANTES ME FUNCIONABA DE LO MÁS BIEN NO SE LO QUE PODRÁ SER

DISCULPEN OS BÁSICO DEL TEMA Y GRACIAS DE ANTEMANO