Zdravim vospolok,
prosím viete mi poradit s nasledovnym problemom, mam nejake udaje ulozene v premennych a chcem spravit update zaznamu podla nakeho id, vyzera to nasledovne.. :
Kód:
$id = $_REQUEST["id"];
$datum_planovania = $_REQUEST["datum_planovania"];
$tabulka = $_REQUEST["tabulka"];
$aktivum = $_REQUEST["aktivum"];
$ucty = $_COOKIE["id_ucet"];
$os = $_REQUEST["os"];
$smer_obchodu=$_REQUEST["smer_obchodu"];
$objem=$_REQUEST["objem"];
$vstupna_cena=$_REQUEST["vst_cena"];
$stop_loss_R=$_REQUEST["stop_loss"];
$profit_target_R=$_REQUEST["profit_target"];
$smer_trhu=$_REQUEST["smer_trhu"];
$nastavenie_podmienok=$_REQUEST["nastavenie_podmienok"];
$pouzity_exit=$_REQUEST["pouzity_exit"];
$position_sizing=$_REQUEST["position_sizing"];
$hodnota_bodu=$_COOKIE["hodnota_bodu"];
$profit_target=$_COOKIE["pt_hodnota"];
$stop_loss=$_COOKIE["sl_hodnota"];
$r_nasobok=$_COOKIE["r_nasobok"];
$zisk_strata=$_COOKIE["zisk_strata"];
$riziko="2";
include "C:/PHP_SQL/xampp/htdocs/Obchodny dennik/otvorDB.php";
// update tabulky plán ---
$sql="update plan SET
ID_UCET = '$ucty',
ID_SYSTEM = '$os',
DATUM = '$datum_planovania',
AKTIVUM = '$aktivum',
SMER = '$smer_obchodu',
POCET_LOTOV = '$objem',
HODNOTA_BODU = '$hodnota_bodu',
VST_CENA = '$vstupna_cena',
VYST_CENA = '0',
SL_BODY = '$stop_loss_R',
SL_HODNOTA = '$stop_loss',
PT_BODY = '$profit_target_R',
PT_HODNOTA = '$profit_target',
ZISK_STRATA = '$zisk_strata',
R_NASOBOK = '$r_nasobok',
RIZIKO = '$riziko',
SMER_TRHU = '$smer_trhu',
PODMIENKY = '$nastavenie_podmienok',
EXIT = '$pouzity_exit',
POSITION_SIZING = '$position_sizing'
where ID_STAV = '$id'";
$vysledok = pripojDB ("trading",$sql); // SQL dotaz
dotaz mi vypise chybu :
Kód:
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 'EXIT = '654654', POSITION_SIZING = '654654' where ID_STAV = '11'' at line 20