1) Try using one of the SELECT queries I posted above to see what's in the database.

2) Try inserting immediately before the "if":
code:
echo "Username='$Username',picwidth='$picwidth',picheight='$picheight'<br>\n";