当前位置: 首页>>代码示例>>PHP>>正文


PHP FC_SQL::rollback方法代码示例

本文整理汇总了PHP中FC_SQL::rollback方法的典型用法代码示例。如果您正苦于以下问题:PHP FC_SQL::rollback方法的具体用法?PHP FC_SQL::rollback怎么用?PHP FC_SQL::rollback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FC_SQL的用法示例。


在下文中一共展示了FC_SQL::rollback方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: elseif

            $fcm->query("insert into weightthresh " . "(shipid,shipzid,shiplid,shipseq,shipamt,shiplow,shiphigh)" . " values " . "({$new_shipid},{$shipzid},{$newlid},{$shipseq},{$shipamt},{$shiplo},{$shiphi})");
        }
    }
    $fct->free_result();
} elseif ($act == "delete") {
    $fcm->query('select numlang from master');
    $fcm->next_record();
    $numl = (int) $fcm->f('numlang');
    $fcm->free_result();
    $numl -= 1;
    $fcm->query("update master set numlang={$numl}");
    $res = $fcl->query("delete from lang where langid={$lngid}");
    $fcl->query("delete from country where ctryzid={$zoneid} and ctrylid={$lngid}");
}
if (!$res) {
    $fcl->rollback();
    echo "<b>failure updating lang: {$res}</b><br>\n";
} else {
    $fcl->commit();
    echo "Work committed.<br>\n";
}
if ($res && $act == "update" && ($langfppromo != $oldfppromo || $oldfppromo == "")) {
    //update cattable first set catact to 0   (bvo)
    $fctb->query("update cat set catact=0 where catval={$langfppromo}");
    $fctb->commit();
    //set the oldfppromo cat back to active if it existed
    if ($oldfppromo) {
        $fctc->query("update cat set catact=1 where catval={$oldfppromo}");
        $fctc->commit();
    }
}
开发者ID:bitweaver,项目名称:bitcart,代码行数:31,代码来源:langupd.php

示例2: count

	and select a default zone.  Thank you.
    <?php 
    exit;
}
$fcm = new FC_SQL();
$fcm->Auto_commit = 0;
$fcm->query("select count(*) as cnt from master");
$fcm->next_record();
if ($fcm->f("cnt") > 0) {
    $fcm->free_result();
    $res = $fcm->query("update master set zoneid={$zoneid}");
} else {
    $res = $fcm->query("insert into master (zoneid) values ({$zoneid})");
}
if (!$res) {
    $fcm->rollback();
    echo "<b>Failure updating master: {$res}</b><br>\n";
} else {
    $fcm->commit();
    echo "Work Committed.<br>\n";
}
?>

<p>

<?php 
if ($zoneid != $oldzid) {
    ?>

The default zone/catalog has changed. Click below to enter 
language profile modification to select the default language for
开发者ID:bitweaver,项目名称:bitcart,代码行数:31,代码来源:masterupd.php

示例3: auxtext

    $res = $fcc->query("insert into auxtext (" . "seq,loc,title,text) values ({$seq},{$loc},'{$title}','{$text}')");
} elseif ($act == "mod") {
    $res = $fcc->query("update auxtext " . "set loc={$loc},title='{$title}', text='{$text}' where rid='{$rid}'");
} elseif ($act == "del") {
    $res = $fcc->query("delete from auxtext " . "where rid={$rid}");
} elseif ($act == "seq") {
    $i = 0;
    while ($i < $scount) {
        $seq = (int) getparam('lseq' . $i);
        $rid = (int) getparam('link' . $i);
        $res = $fcc->query("update auxtext set seq={$seq} where rid='{$rid}'");
        $i++;
    }
}
if (!$res) {
    $fcc->rollback();
    echo "<b>failure updating auxtext: {$res}</b><br />\n";
} else {
    $fcc->commit();
    echo "Work committed.<br />\n";
}
?>

<p></p>

<?php 
if ($act == "add") {
    ?>
<a href="auxtextadd.php?zoneid=<?php 
    echo $zoneid;
    ?>
开发者ID:bitweaver,项目名称:bitcart,代码行数:31,代码来源:auxtextupd.php

示例4: prodopt

    // add the product option
    if ($databaseeng == 'odbc' && $dialect == 'solid') {
        $pr = $fcp->query("call popt_ins (" . "{$zoneid},{$langid},{$poptgrp},{$poptseq},'{$ssku}','{$poptskumod}','{$poptskusub}'," . "{$poptsetup},{$poptprice},{$osssdate},{$ossedate},{$ossaleprice},{$ossdate}," . "{$osedate},{$osaleprice}," . "'{$poptpic}',{$poptpich},{$poptpicw}," . "'{$popttpic}',{$popttpich},{$popttpicw}," . "'{$poptname}','{$poptsdescr}','{$poptdescr}'," . "'{$popttext1}','{$popttext2}','{$popttext3}'," . "{$poptflag1},{$poptflag2})");
    } else {
        $pr = $fcp->query("insert into prodopt (" . "poptzid,poptlid,poptgrp,poptseq,poptsku,poptskumod,poptskusub,poptsetup," . "poptprice,poptssalebeg,poptssaleend,poptssaleprice," . "poptsalebeg,poptsaleend," . "poptsaleprice,poptpic,poptpich,poptpicw," . "popttpic,popttpich,popttpicw,poptname,poptsdescr,poptdescr,popttext1," . "popttext2,popttext3,poptflag1,poptflag2" . ") values (" . "{$zoneid},{$langid},{$poptgrp},{$poptseq},'{$ssku}','{$poptskumod}','{$poptskusub}'," . "{$poptsetup},{$poptprice},{$osssdate},{$ossedate},{$ossaleprice},{$ossdate}," . "{$osedate},{$osaleprice},'{$poptpic}',{$poptpich},{$poptpicw}," . "'{$popttpic}',{$popttpich},{$popttpicw}," . "'{$poptname}','{$poptsdescr}','{$poptdescr}'," . "'{$popttext1}','{$popttext2}','{$popttext3}'," . "{$poptflag1},{$poptflag2}" . ")");
    }
} elseif ($act == 'update') {
    $pr = $fcp->query("update prodopt set " . "poptgrp={$poptgrp},poptseq={$poptseq}," . "poptskumod='{$poptskumod}',poptskusub='{$poptskusub}',poptsetup={$poptsetup}," . "poptprice={$poptprice},poptssalebeg={$osssdate},poptssaleend={$ossedate}," . "poptssaleprice={$ossaleprice},poptsalebeg={$ossdate},poptsaleend={$osedate}," . "poptsaleprice={$osaleprice},poptpic='{$poptpic}',poptpich={$poptpich},poptpicw={$poptpicw}," . "popttpic='{$popttpic}',popttpich={$popttpich},popttpicw={$popttpicw}," . "poptname='{$poptname}',poptsdescr='{$poptsdescr}',poptdescr='{$poptdescr}'," . "popttext1='{$popttext1}',popttext2='{$popttext2}',popttext3='{$popttext3}'," . "poptflag1={$poptflag1},poptflag2={$poptflag2} " . "where poptid={$poptid}");
} elseif ($act == 'delete') {
    $pr = $fcp->query("delete from prodopt where poptid={$poptid}");
}
if ($pr) {
    $fcp->commit();
    echo "Work committed.\n";
} else {
    $fcp->rollback();
    echo "Error: work rolled back.\n";
}
if ($act == 'update') {
    // make all group member flags look like this one
    $pr = $fcp->query("update prodopt set poptflag1={$poptflag1},poptflag2={$poptflag2} " . "where poptsku='{$ssku}' and poptgrp={$poptgrp}");
    $fcp->commit();
}
//set the prodlflag correctly        bvo
/*
First the options after updating all tables are fetched again
if there is an option in the current language defined it is
inserted into prodlflag1
(bvo)
*/
$fcco = new FC_SQL();
开发者ID:bitweaver,项目名称:bitcart,代码行数:31,代码来源:prodoptupd.php

示例5: elseif

    exit;
}
$fcw = new FC_SQL();
if ($act == "update") {
    $res = $fcw->query("update web set " . "webautodom='{$autodom}'," . "realhome='{$realhome}',   carthome='{$carthome}'," . "webback='{$back}',        webtitle='{$webtitle}', " . "weblogo='{$logo}',        weblogow={$logow}, weblogoh={$logoh}," . "webbg='{$webbg}',         webtext='{$webtext}', weblink='{$weblink}'," . "webvlink='{$webvlink}',   webalink='{$webalink}'," . "webhdsku='{$headsku}',    webhdtext='{$headtext}'," . "webhdgraph='{$headgraph}',webhdgraphh={$headgraphh}," . "webhdgraphw={$headgraphw},webftsku='{$footsku}', " . "webfttext='{$foottext}',  webftgraph='{$footgraph}'," . "webftgraphh={$footgraphh},webftgraphw={$footgraphw}," . "webdaysinnew={$daysinnew},webcattext='{$cattext}'," . "webnewlogo='{$newlogo}',  webnewlogoh={$newlogoh}," . "webnewlogow={$newlogow},  webnewmast='{$newmast}'," . "webnewmasth={$newmasth},  webnewmastw={$newmastw}," . "webspeclogo='{$speclogo}',webspeclogoh={$speclogoh}," . "webspeclogow={$speclogow},webspecmast='{$specmast}'," . "webspecmasth={$specmasth},webspecmastw={$specmastw}," . "webviewlogo='{$viewlogo}',webviewlogow={$viewlogow}," . "webviewlogoh={$viewlogoh},websort='{$websort}'," . "webdescr='{$webdescr}',   webzid={$zoneid}, " . "weblid={$langid},         webfree='{$webfree}', " . "webdesctmpl='{$webdesctmpl}'," . "webflags1={$webflags1},   webprodpage={$prodpage} " . "where webid={$webid} and webzid={$zoneid} and weblid={$langid}");
} elseif ($act == "new") {
    if ($databaseeng == 'odbc' && $dialect == 'solid') {
        $res = $fcw->query("call web_ins ({$zoneid},{$langid}," . "'{$webdescr}','{$realhome}', '{$carthome}', '{$webtitle}'," . "'{$back}',    '{$logo}',      {$logow},      {$logoh},     '{$webbg}'," . "'{$webtext}', '{$weblink}',  '{$webvlink}', '{$webalink}', '{$headsku}'," . "'{$headtext}','{$headgraph}', {$headgraphw}, {$headgraphh},'{$footsku}'," . "'{$foottext}','{$footgraph}', {$footgraphw}, {$footgraphh}, {$daysinnew}," . "'{$newlogo}',  {$newlogow},   {$newlogoh},  '{$newmast}',   {$newmastw}," . " {$newmasth}, '{$speclogo}',  {$speclogow},  {$speclogoh}, '{$specmast}'," . " {$specmastw}, {$specmasth}, '{$viewlogo}',  {$viewlogow},  {$viewlogoh}," . "'{$cattext}', '{$autodom}',  '{$websort}',  '{$webfree}'," . "'{$webdesctmpl}',{$webflags1},{$prodpage})");
    } else {
        $res = $fcw->query("insert into web (" . "webzid,weblid,webdescr,realhome,carthome,webtitle,webback," . "weblogo,weblogow,weblogoh,webbg,webtext,weblink,webvlink," . "webalink," . "webhdsku,webhdtext,webhdgraph,webhdgraphw,webhdgraphh," . "webftsku,webfttext,webftgraph,webftgraphw,webftgraphh," . "webdaysinnew," . "webnewlogo,webnewlogow,webnewlogoh," . "webnewmast,webnewmastw,webnewmasth," . "webspeclogo,webspeclogow,webspeclogoh," . "webspecmast,webspecmastw,webspecmasth," . "webviewlogo,webviewlogow,webviewlogoh," . "webcattext,webautodom,websort,webfree," . "webdesctmpl,webflags1,webprodpage)" . " values " . "({$zoneid},{$langid}," . "'{$webdescr}','{$realhome}', '{$carthome}', '{$webtitle}'," . "'{$back}',    '{$logo}',      {$logow},      {$logoh},     '{$webbg}'," . "'{$webtext}', '{$weblink}',  '{$webvlink}', '{$webalink}', '{$headsku}'," . "'{$headtext}','{$headgraph}', {$headgraphw}, {$headgraphh},'{$footsku}'," . "'{$foottext}','{$footgraph}', {$footgraphw}, {$footgraphh}, {$daysinnew}," . "'{$newlogo}',  {$newlogow},   {$newlogoh},  '{$newmast}',   {$newmastw}," . " {$newmasth}, '{$speclogo}',  {$speclogow},  {$speclogoh}, '{$specmast}'," . " {$specmastw}, {$specmasth}, '{$viewlogo}',  {$viewlogow},  {$viewlogoh}," . "'{$cattext}', '{$autodom}',  '{$websort}',  '{$webfree}'," . "'{$webdesctmpl}',{$webflags1},{$prodpage})");
    }
} elseif ($act == "delete") {
    $res = $fcw->query("delete from web " . "where webid={$webid} and webzid={$zoneid} and weblid={$langid}");
}
if (!$res) {
    $fcw->rollback();
    echo "<b>failure updating web: {$res}</b><br>\n";
} else {
    $fcw->commit();
    echo "Work committed.<br>\n";
}
?>

<p>

<form method=post action="index.php">
<input type=hidden name=zoneid value=<?php 
echo $zoneid;
?>
>
<input type=hidden name=langid value=<?php 
开发者ID:bitweaver,项目名称:bitcart,代码行数:31,代码来源:webupd.php

示例6: elseif

                if ($databaseeng == 'odbc' && $dialect == 'solid') {
                    $res = $fcs->query("call subzship_ins (" . "{$subzsid},{$this_subzshipid},0)");
                } else {
                    $res = $fcs->query("insert into subzship " . "(shipszid,shipid,shipdef,shiplid)" . " values " . "({$subzsid},{$this_subzshipid},0,{$langid})");
                }
            }
            $i++;
        }
    }
} elseif ($act == 'delete') {
    $res = $fcs->query("delete from subzone " . "where subzid={$zoneid} and subzsid={$subzsid}");
    $res = $fcs->query("delete from subzship " . "where shipszid={$subzsid} and shiplid={$langid}");
}
// if ($act == 'update')
if (!$res) {
    $fcs->rollback();
    echo "<b>Failure updating subzone: {$res}</b><br />\n";
} else {
    $fcs->commit();
    echo "Work Committed.<br />\n";
}
if ($act == 'insert') {
    ?>
 <form method=post action="subzoneadd.php">
<?php 
} else {
    ?>
 <form method=post action="subzonendx.php">
<?php 
}
?>
开发者ID:bitweaver,项目名称:bitcart,代码行数:31,代码来源:subzoneupd.php

示例7: mktime

if ($sem && $sed && $sey) {
    $sedate = mktime(23, 59, 59, $sem, $sed, $sey);
} else {
    $sedate = 0;
}
// end if
if ($act == "update") {
    $res = $coupon->query("update coupon set " . "cpnid='{$cpnid}',     cpnsku='{$cpnsku}',     cpnstart={$ssdate}, " . "cpnstop={$sedate},    cpnminqty={$cpnminqty}, cpnminamt={$cpnminamt}, " . "discount={$discount}, cpnredeem={$cpnredeem}, cpnmaximum={$cpnmaximum} " . "where cpnid='{$oldcpnid}'");
} elseif ($act == "new") {
    $res = $coupon->query("insert into coupon " . "(cpnid,cpnsku,cpnstart,cpnstop,cpnminqty,cpnminamt,discount," . "cpnredeem,cpnmaximum)" . " values " . "('{$cpnid}','{$cpnsku}',{$ssdate},{$sedate},{$cpnminqty},{$cpnminamt}," . "{$discount},0,{$cpnmaximum})");
} elseif ($act == "delete") {
    $res = $coupon->query("delete from coupon where cpnid='{$cpnid}'");
}
// end update & insert queries
if (!$res) {
    $coupon->rollback();
    echo "<b>failure updating coupon: {$res}</b><br />\n";
} else {
    $coupon->commit();
    echo "Work committed.<br />\n";
}
// end if
?>

<p>

<form method="post" action="couponndx.php">
<input type="hidden" name="zoneid" value="<?php 
echo $zoneid;
?>
" />
开发者ID:bitweaver,项目名称:bitcart,代码行数:31,代码来源:couponupd.php

示例8: with

    // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_con_7a_1hf7.asp
    $msupd = ' with (UPDLOCK)';
    $flck->query("begin transaction");
} elseif ($databaseeng == 'oracle') {
    $flck->query("lock table ohead in row exclusive mode");
} elseif ($databaseeng == 'odbc' && '' == 'solid') {
    // in pessimistic mode, set at table creation, should be exclusive lock
    // rollback/commit breaks the lock
    $forupd = ' for update';
    $flck->query("set transaction read write");
}
$fcoc = new FC_SQL();
$fcoc->query("select aid,contrib,shipid,subz,couponid from ohead{$msupd} " . "where orderid='{$cartid}' and complete < 1{$forupd}");
if (!$fcoc->next_record()) {
    echo fc_text('invalidorder');
    $fcoc->rollback();
    if ($databaseeng == 'mysql') {
        $flck->query('unlock tables');
    }
    if ($databaseeng == 'postgres') {
        $flck->query('rollback work');
    }
    exit;
}
$curshipid = (int) $fcoc->f("shipid");
$subz = (int) $fcoc->f("subz");
$couponid = $fcoc->f("couponid");
if ($zflag1 & $flag_zonetclink && $approvetc == 0) {
    // terms and conditions were not approved
    // if javascript is working we should never get here
    ?>
开发者ID:bitweaver,项目名称:bitcart,代码行数:31,代码来源:orderproc.php

示例9: elseif

    $fcm->query("update master set numzone={$numz}");
    // on a new zone we cannot yet select a default language
    // profile as it does not exist yet, so set to 0
    // index.php will see the 0 default, force a new language,
    // and langupd.php will force the new language as the default
    // for this zone when it sees that zonedeflid is 0
    if ($databaseeng == 'odbc' && $dialect == 'solid') {
        $res = $fcz->query("call zone_ins " . "('{$zonedescr}','{$zonecurrsym}',{$zoneact},{$zflag1},0)");
    } else {
        $res = $fcz->query("insert into zone " . "(zonedescr,zonecurrsym,zoneact,zflag1,zonedeflid)" . " values " . "('{$zonedescr}','{$zonecurrsym}',{$zoneact},{$zflag1},0)");
    }
} elseif ($act == "delete") {
    $res = $fcz->query("delete from zone where zoneid={$zoneid}");
}
if (!$res) {
    $fcz->rollback();
    echo "<b>Failure updating zone: {$res}</b><br>\n";
} else {
    $fcz->commit();
    echo "Work Committed.<br>\n";
}
?>

<p>
<?php 
if ($act == "new") {
    ?>
You have added a new zone.  When you return to the central maintenance page,
you will immediately be prompted for a minimal set of support profiles for 
this new zone.  This will include a new language profile, web profile, 
vendor profile, at least one subzone profile, and so forth.  Please fill these
开发者ID:bitweaver,项目名称:bitcart,代码行数:31,代码来源:zoneupd.php


注:本文中的FC_SQL::rollback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。