Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/07/2008, 22:42
Avatar de JairLizcano
JairLizcano
 
Fecha de Ingreso: junio-2008
Ubicación: Santander, Colombia
Mensajes: 608
Antigüedad: 16 años, 9 meses
Puntos: 53
Exclamación Error registro mysql

...el codigo con el que estoy trabajando es el siguiente:

Código PHP:
<?php


    
if(isset($_POST['nick']) && !empty($_POST['nick']) &&
    isset(
$_POST['email']) && !empty($_POST['email'])) {

      

        
$link mysql_connect("localhost","root","");
        
mysql_select_db("webdb",$link);

     
        
mysql_query("INSERT INTO registros (nick,email)
        VALUES ('{$_POST['nick']}','{$_POST['email']}')"
,$link);

   
        
$my_error mysql_error($link);

        if(!empty(
$my_error) {

            echo 
"Ha habido un error al insertar los valores. $my_error"

        } else {

            echo 
"Los datos han sido introducidos satisfactoriamente";

        }

    } else {

        echo 
"Error, no ha introducido todos los datos";

    }

?>
Base de datos: Registros
Tabla: Usuarios ( nick,email )


...el formulario es el siguiente:

Código PHP:
<form id="form1" name="form1" method="post" action="insertar_datos.php">
  <
table width="200" border="1" align="center">
    <
tr>
      <
td width="54"><div align="right">Nombre:</div></td>
      <
td width="130"><input type="text" name="textfield" id="textfield" /></td>
    </
tr>
    <
tr>
      <
td><div align="right">Password:</div></td>
      <
td><input type="password" name="textfield2" id="textfield2" /></td>
    </
tr>
  </
table>
  <
p align="center">
    <
input type="submit" name="button" id="button" value="Enviar" />
  </
p>
</
form
// Insertar_datos.php es donde esta mencionado la respectiva query...

...ya establecido el codigo, mi error es el siguiente:

Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\insertar_datos.php on line 25

Linea 25: if(!empty($my_error) {

...alguna solucion?