$mysqli
=
new
mysqli(
$host
,
$user
,
$password
,
$database
);
$query
=
"INSERT INTO images (project_id, user_id, image_name, date_created, link_to_file, link_to_thumbnail, given_name) VALUES ('$project_id', '$user_id', '$image_name', '$date_created', '$link_to_file', '$thumbnail', '$ImageName');"
;
$query
.=
"INSERT INTO images_history (project_id, user_id, image_name, date_created, link_to_file, link_to_thumbnail, given_name, day, month, year) VALUES ('$project_id', '$user_id', '$image_name', '$date_created', '$link_to_file', '$thumbnail', '$ImageName', '$day', '$month', '$year');"
;
$result
= mysqli_multi_query(
$mysqli
,
$query
);
if
(
$result
) {
do
{
$result
= mysqli_store_result(
$mysqli
);
}
while
(mysqli_more_results(
$mysqli
) && mysqli_next_result(
$mysqli
));
}
else
{
echo
"First query failed: "
. mysqli_error(
$mysqli
);
}