I am having trouble with this code:
<?php
// Username
$username = $_POST['name'];
$email = $_POST['email'];
$default = "default image";
$size = 40;
// MYSQL
mysql_connect('host','username','password');
mysql_select_db('database');
$grav_url = "www.gravatar.com/avatar/" . md5( strtolower( trim( $email ) ) ) . "?d=" . urlencode( $default ) . "&s=" . $size;
$sql = "INSERT INTO `db` (profile image) VALUES mysql_real_escape_string($grav_url) WHERE id='{$_SESSION['sessid']}'";
mysql_query($sql);
echo "Profile image updated. <a href='update.php'>Go back.</a>";
?>
The problem is that this does not work, but displays no error. I look in the data base and it is not updated. I don't know why.