PHPFAQ  
      MySQL   PDO               SafeMySQL  
-- -- --
SQL phpMyAdmin PHP
dimas103 19.06.12 18:00
1 obmen.php . phpMyAdmin . PHP : "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO jos_vm_product_category_xref (category_id, product_id, product_li' at line 4"

?

[code]<?php
$path = $_SERVER['DOCUMENT_ROOT'];
//echo $path ;
$sdb_name = 'localhost';
$user_name = 'root';
$user_password = '';
$db_name = 'l_lamp';
//
if (!$link = mysql_connect($sdb_name,$user_name,$user_password))
{
echo '<br> !<br>';
exit();
}
//
if (!mysql_select_db($db_name, $link))
{ mysql_query("SET NAMES utf8");
echo '<br> <br>';
exit(); }
$filename =$path.'/tmp/obmen.csv';
$filenamesetting =$path.'/tmp/obmen.ini';
$line = array();
//
$str_sql_query = "INSERT INTO jos_vm_product
(product_sku,product_thumb_image,product_full_image,product_publish,product_name)
VALUES ('4050300528502','FC_40W_865.png','FC_40W_865.png','Y','FC 40W/865');
INSERT INTO jos_vm_product_category_xref (category_id, product_id, product_list)
VALUES(13,(SELECT jos_vm_product.product_id
FROM
jos_vm_product
WHERE
jos_vm_product.product_sku = 4050300528502),1);
DELETE FROM jos_vm_product_type_5 WHERE jos_vm_product_type_5.`product_id` =
(SELECT jos_vm_product.`product_id`
FROM
jos_vm_product
WHERE
jos_vm_product.product_sku = '4050300528502');
INSERT INTO jos_vm_product_type_5 (product_id,lum_lamps_cap,lum_lamps_color,lum_lamps_watt) VALUES ((SELECT jos_vm_product.`product_id`
FROM
jos_vm_product
WHERE
jos_vm_product.product_sku = '4050300528502'),'2Gx13','865',40);
DELETE FROM jos_vm_product_product_type_xref WHERE jos_vm_product_product_type_xref.`product_id` =
(SELECT jos_vm_product.`product_id`
FROM
jos_vm_product
WHERE
jos_vm_product.product_sku = '4050300528502');
INSERT INTO jos_vm_product_product_type_xref (product_id,product_type_id) VALUES(
(SELECT jos_vm_product.`product_id`
FROM
jos_vm_product
WHERE
jos_vm_product.product_sku = '4050300528502'),5);";
//
if (!$tbl = mysql_query($str_sql_query, $link))
{ $line[] = 'error'; echo "|";echo mysql_error();
file_put_contents($filenamesetting, implode("\r\n", $line));
echo "<br> <br>";
exit();
}
//
mysql_close($link);
?>
[/code]
:*
:*
?
:
, .
, , .

© phpfaq.ru, 2019 1558955663.007 sec.     iHor.ru