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

Muchas gracias ya lo logre esa er ala prueba pero ahora tengo problemas con este no se si pueden ser tan amables de volver a revisar desde ya muchas gracias y aqui dejo el codigo html:

<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="basecliente.php" method="get">
<table width="100%" height="259" border="0">
<tr>
<td width="12%"><div align="right">Ingreso de Datos</div></td>
<td></td>
</tr>
<tr>
<td height="35">Nombres</td>
<td>: <input name="text1" type="text" id="1"></td>
</tr>
<tr>
<td>Apellidos</td>
<td>: <input name="text2" type="text" id="2"

</tr>
<tr>
<td>Rut</td>
<td>: <input name="text3" type="text" id="3"></td>
</tr>
<tr>
<td>Dirección</td>
<td>: <input name="text4" type="text" id="4"></td>
</tr>
<tr>>
<td>Comuna</td>
<td>: <input name="text5" type="text" id="5"></td>
</tr>
<tr>
<td>Telefono</td>
<td>: <input name="text6" type="text" id="6"></td>
<tr>
<td>Celular</td>
<td>: <input name="text7" type="text" id="7"></td>
</tr>
<tr>
<td></td>
<td><div align="center"><input name="Guardar" type="submit"><input name="limpiar" type="reset"></div></td>
</tr>
</table>
</form>
</body>
</html>

Y POR AQUI EL PHP Q SOLO INSERTA Y ME GUSTARAI SABER BIEN COMO DEBIERA SER ELCODIGO PARA MOSTRAR LO QUE SELECCIONO CON SELECT * FROM

<?php
$nombre=$_POST['text1'];
$apellido=$_POST['text2'];
$rut=$_POST['text3'];
$direccion=$_POST['text4'];
$comuna=$_POST['text5'];
$telefono=$_POST['text6'];
$celular=$_POST['text7'];

if(!($conexion=mysql_connect("localhost","root","" ))){
die('no se pudo conectar: '. mysql_error());
}
else{
mysql_select_db("libreta",$conexion);
$q=mysql_query("insert into cliente (nombre,apellido,rut,telefono,celular,direccion,co muna) values ('$nombre','$apellido','$rut','$telefono','$celula r','$direccion','$comuna')");
echo "todo bien;
}
mysql_close($conexion);
?>


Y EL ERROR ES

Parse error: syntax error, unexpected end of file in C:\wamp\www\basecliente.php on line 19

PERO EN ESA LINEA ESTA EL CIERRE DEL CODIGO PHP,

GRACIAS POR SU GRAN AYUDA DE ANTEMANO