SQL – update / delete

通常update

$StrSQL =
    "update GVIS_zaiko " . "\n" 
  . "   set GVIS_No      = '" . $mysqli->real_escape_string($InputParm_GVIS_No) . "' \n"
  . "     , Toroku       = '" . $mysqli->real_escape_string($InputParm_Toroku) . "' \n"
  . "     , Massho       = '" . $InputParm_Massho . "' \n"
  . "     , Category1    = '" . $mysqli->real_escape_string($InputParm_Category1) . "' \n"
  . "     , Category2    = '" . $mysqli->real_escape_string($InputParm_Category2) . "' \n"
  . "     , Tehai        = '" . $mysqli->real_escape_string($InputParm_Tehai) . "' \n"
  . "     , MakerURL     = '" . $mysqli->real_escape_string($InputParm_MakerURL) . "' \n"
  . "     , ShanaiURL    = '" . $mysqli->real_escape_string($InputParm_ShanaiURL) . "' \n"
  . "     , Kazu         =  " . $InputParm_Kazu . " \n"
  . "     , YoteiTnk     =  " . $InputParm_YoteiTnk . " \n"
  . "     , ShutokuKng   =  " . $InputParm_ShutokuKng . " \n"
  . "     , KoteiShisan  =  " . $InputParm_KoteiShisan . " \n"
  . "     , ShokyakuHou  = '" . $InputParm_ShokyakuHou . "' \n"
  . "     , TaiyoNen     =  " . $InputParm_TaiyoNen_Nen . " \n"
  . "     , ShokyakuRit  =  " . $InputParm_TaiyoNen_Rit . " \n"
  . "     , JigyoWariai  =  " . $InputParm_JigyoWariai . " \n"
  . "     , weight       =  " . $InputParm_weight . " \n"
  . "     , electricity  =  " . $InputParm_electricity . " \n"
  . "     , Biko         = '" . $mysqli->real_escape_string($InputParm_Biko) . "' \n"
  . "     , alwayson     =  " . $InputParm_alwayson . " \n"
  . "     , upd_date   = '" . $gv_DATE . "' \n"
  . "     , upd_user   = '" . $gv_user . "' \n"
  . " where SerialShubetsu = '" . $InputParm_shisanKBN . "' \n"
  . "   and     SerialSeq1 =  " . $InputParm_Seq1 . " \n"
  . "   and     SerialSeq2 =  " . $InputParm_Seq2 . " \n"
  . " ; " . "\n"

blobのupdate

$StrSQL =
    "update GVIS_zaiko " . "\n" 
  . "   set BLOB_data"   .$Youso. " = '" . $img_bin . "' \n"
  . "     , BLOB_extent" .$Youso. " = '" . $img_ext . "' \n"
  . "     , BLOB_medium" .$Youso. " = '" . $img_binMini . "' \n"
  . "     , upd_date   = '" . $gv_DATE . "' \n"
  . "     , upd_user   = '" . $gv_user . "' \n"
  . " where SerialShubetsu = '" . $_SESSION["ATT102-arg1"] . "' \n"
  . "   and     SerialSeq1 =  " . $_SESSION["ATT102-arg2"] . " \n"
  . "   and     SerialSeq2 =  " . $_SESSION["ATT102-arg3"] . " \n"
  . " ; " . "\n"

通常のdelete

$StrSQL =
    "delete GVIS_work "
  . " from GVIS_work ". "  \n"
  . " where  year(workPeriod) = " . $InputYyyy. "  \n"
  . "   and month(workPeriod) = " . $InputMm. "  \n"
  . "   and workPriority = " . intval($InputParm2) . "  \n"
  . " ; ". "  \n"

コメント

タイトルとURLをコピーしました