Hi, im having problems inserting new data to the database...
i really don't know what's going on, im able to make a "select * from..." and display it properly; but when trying to make an insert it just doesn't work... it seems ok, there are no error messages, but when i check the database to see the new row it's just not there π...
if i display the query (echo $queryπ, copy and execute it manually at the mysql server it works fine...
its a connection problem? (then why can i make a select from php?)
thanks a lot π
ps: sorry for my bad english
<html>
<body>
<?php
if($submit)
{
$base= mysql_connect("localhost", "root"); mysql_select_db("buscomusico",$base);
$query= "INSERT INTO usuario (nombre, nick, clave, email, telefono) VALUES ('$nombre', '$nick', '$password', '$email', '$telefono')";
echo $query;
$resultado= mysql_query($sql);
?>
<form method="post" action="<?php echo $PHP_SELF?>">
Nombre y Apellido: <input type="text" name="nombre" maxlength="20" size="20"> <br>
Nick: <input type="text" name="nick" size="20" maxlength="20"> <br>
clave: <input type="text" name="password" size="20" maxlength="20"> <br>
email: <input type="text" name="email" size="20" maxlength="20"> <br>
telefono: <input type="text" name="telefono" size="20" maxlength="20"> <br>
<input type="submit" name="submit" value="Submit">
<input type="reset" name="reset" value="Reset">
</form>