I am using the JQuery upload and crop plugin which can be found here:
http://www.webmotionuk.co.uk/jquery/image_upload_crop.php
The code works fine and as expected but the one change I wish to make is to insert the saved thumbnail name into a mysql table but for some reason I can't get this to work. It would be too much to post the full code so I will try and narrow it down:
updateavatar.php :
require("../db.php");
$avatar = mysql_real_escape_string($_POST['avatar']);
$email = mysql_real_escape_string($_POST['email']);
mysql_query("UPDATE admin SET avatar='".$avatar."' WHERE email='".$email."'");
Any help is greatly appreciated!
error_log($avatar. ' - ' .$email)does it print what you're expecting to see? Also, you're not passing in a connection string to mysql_query, so I'm assuming you already have a connection open. If not, you need it. If you do have a connection, does the mysql_query function return true or false?mysqlconnectin thedb.phpwhich is included. I added in theerror_logbut don't seem to get anything different. Also, the way it fails is simply not updating the appropriate row in the database. I don't see any errors at all to do with syntax etc.error_logprints outadminwhich is the user I am signed in as so it appears the variable for the filename is wrong. From looking at the plug in code I was sure this was the right variable, hmmmmm