【问题标题】:need to insert from grid to mysql database需要从网格插入到mysql数据库
【发布时间】:2014-06-25 15:10:34
【问题描述】:

当我将此代码放在 ProcessMaker 上的触发器中时,我想将我在我的网格中的数据插入到我的数据库中的表“报价”中。 当我尝试使用正常形式时,它可以工作,但是如果网格可以工作,我认为这是语法问题,或者 foreach gridsizerows n 不是,有人可以帮助我: 这是代码

$i=0 foreach ($i < $gridsizerows) {
   $i = i +1;
   $id = @mygrid [$i]['id'];
   $quantity = @mygrid[$i]['quantity'];
   $pu = @mygrid[$i]['possible'];
   $pt = @mygrid[$i]['pt'];
   $to = @mygrid [$i]['designation'];
   $sql = "INSERT INTO quotes (id, designation, quantity, pu, pt) VALUES ($id, $from, $pu, $pt, $amount)";
   $tmp_db = executeQuery($sql, '90911865253a802b030e577077431812');
}

【问题讨论】:

  • }////// $i=0 foreach ($ i

标签: mysql triggers grid processmaker


【解决方案1】:

您的代码看起来不错,您可能想要做的 2 项更改如下所示..

而不是这个:

$sql = "INSERT INTO quotes (id, designation, quantity, pu, pt) VALUES ($id, $from, $pu, $pt, $amount)";

使用这个:

$sql = "INSERT INTO quotes (id, designation, quantity, pu, pt) VALUES ('$id', '$from', '$pu', '$pt', '$amount')";

而不是这个:

$tmp_db = executeQuery($sql, '90911865253a802b030e577077431812');

使用这个:

$dbConn = '90911865253a802b030e577077431812';
$tmp_db = executeQuery($sql, $dbConn);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-24
    • 1970-01-01
    • 2020-04-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多