%
$hostname = "localhost";
$password = "";
$user = "www";
$database = "prosveta01";
$language = "fr";
mysql_pconnect($hostname,$user,$password) or die("Unable to connect to SQL server");
mysql_select_db("$database") or die("Unable to select database");
$result = mysql_query("Select language_id From languages Where language_code = '$language'");
while ($row = mysql_fetch_array($result)) {
$language_id = $row[language_id];
}
%>
<%
if ($product_image_small_size != "0") {
$sql_product_image_small = "product_image_small = '$product_image_small_name', ";
}
if ($product_image_large_size != "0") {
$sql_product_image_large = "product_image_large = '$product_image_large_name',";
}
//$update_query = "product_collection_id = '$product_collection_id', product_topic_id = '$product_topic_id', product_country_id = '$product_country_id', product_language_id = '$product_language_id', product_reference = '$product_reference', product_author = '$product_author', product_name = '$product_name', product_tome = '$product_tome', product_title = '$product_title', product_description = '$product_description', product_summary = '$product_summary', product_contents = '$product_contents', product_year = '$product_year', product_isbn = '$product_isbn', product_image_small = '$product_image_small_name', product_image_large = '$product_image_large_name', product_sound = '$product_sound', product_video = '$product_video', product_availability = '$product_availability', product_promotion = '$product_promotion', product_republication = '$product_republication'";
$update_query = "product_collection_id = '$product_collection_id', product_topic_id = '$product_topic_id', product_country_id = '$product_country_id', product_language_id = '$product_language_id', product_reference = '$product_reference', product_author = '$product_author', product_name = '$product_name', product_tome = '$product_tome', product_title = '$product_title', product_description = '$product_description', product_summary = '$product_summary', product_contents = '$product_contents', product_year = '$product_year', product_isbn = '$product_isbn', $sql_product_image_small $sql_product_image_large product_sound = '$product_sound', product_video = '$product_video', product_availability = '$product_availability', product_promotion = '$product_promotion', product_republication = '$product_republication'";
//$update_query = stripslashes($update_query);
if ($product_image_small_size != "0") {
exec( "cp $product_image_small /web/htdocs/shop.reperes.com/prosveta/images/products/images_small/tmp/$product_image_small_name");
}
if ($product_image_large_size != "0") {
exec( "cp $product_image_large /web/htdocs/shop.reperes.com/prosveta/images/products/images_large/tmp/$product_image_large_name");
}
echo "query : $update_query
";
$result = mysql_db_query($database, "Update products set $update_query Where product_id='$id'");
if (!$result)
{
echo "Error
";
echo "SQL-query $sql_query produced an error.
";
echo "MySQL said: ".mysql_error();
}
//$sql = "INSERT INTO nom_base (test,test,test,test,product_image_small) ".
//"VALUES ('$test,$test,$test,$test,$product_image_small_name')";
// exec( "cp $picture /web/htdocs/shop.reperes.com/prosveta/images/products/images_small/$product_image_small_name");
echo "id: $id
small: $product_image_small";
echo "temp file: $product_image_small
\n";
echo "file name: $product_image_small_name
\n";
echo "file size: $product_image_small_size
\n";
echo "file type: $product_image_small_type
\n";
echo "temp file: $product_image_large
\n";
echo "file name: $product_image_large_name
\n";
echo "file size: $product_image_large_size
\n";
echo "file type: $product_image_large_type
\n";
%>