Aquí el código:
Código PHP:
<?php
$query_iuid = "SELECT EMAIL FROM FREE_USERS WHERE EMAIL = '".mysql_real_escape_string($_POST['email'])."'";
$result_query_iuid = mysql_query($query_iuid);
if(mysql_num_rows($result_query_iuid) == 1) {
$query_update = "UPDATE FREE_USERS SET UPLOADS = UPLOADS + 1 WHERE EMAIL = '".mysql_real_escape_string($_POST['email'])."'";
$result_query_update = mysql_query($query_update);
} else {
$query_add_user = "INSERT INTO FREE_USERS VALUES('$IUID', '1', '".date("Y/n/j, H:i:s")."', '".mysql_real_escape_string($_POST['email'])."')";
$result_query_add_user = mysql_query($query_add_user);
$query_add_tmp_user = "INSERT INTO TMP_FREE_USERS VALUES('$IUID', '".date("Y/n/j, H:i:s")."')";
$result_query_add_tmp_user = mysql_query($query_add_tmp_user);
}
$query_search_iuid = "SELECT IUID FROM FREE_USERS WHERE EMAIL = '".mysql_real_escape_string($_POST['email'])."'";
$result_query_search_iuid = mysql_query($query_search_iuid);
if(mysql_num_rows($result_query_search_iuid) == 1) {
$query_more_iuid = "SELECT * FROM FREE_USERS WHERE EMAIL = '".mysql_real_escape_string($_POST['email'])."'";
$resultquery_more_iuid = mysql_query($query_more_iuid);
$row = mysql_fetch_assoc($resultquery_more_iuid);
$query_insert_images = "INSERT INTO IMAGES VALUES ('".$row['IUID']."', '$id', '$name', '".strtoupper($type)."', '$size_format', '$dimensions', '$date', '$location', '$image_base64', '$pin')";
$result_query_insert_images = mysql_query($query_insert_images);
$query_insert_tmp_images = "INSERT INTO TMP_FREE_IMAGES VALUES ('$id', '$date')";
$result_query_insert_tmp_images = mysql_query($query_insert_tmp_images);
} else {
$query_insert_images = "INSERT INTO IMAGES VALUES ('$IUID', '$id', '$name', '".strtoupper($type)."', '$size_format', '$dimensions', '$date', '$location', '$image_base64', '$pin')";
$result_query_insert_images = mysql_query($query_insert_images);
$query_insert_tmp_images = "INSERT INTO TMP_FREE_IMAGES VALUES ('$id', '$date')";
$result_query_insert_tmp_images = mysql_query($query_insert_tmp_images);
}
?>