在iis上使用php更新多行mssql

时间:2016-11-25 09:46:45

标签: php sql-server iis

我想更新多行我的表sql server在iis上使用php 7,我有这样的脚本

this is my script

这是我点击"提交"按键                 

            $getResults= sqlsrv_query($conn, $tsql, $params);
            $rowsAffected = sqlsrv_rows_affected($getResults);
            if ($getResults == FALSE or $rowsAffected == FALSE)
                die(FormatErrors(sqlsrv_errors()));
            echo ($rowsAffected. " row(s) updated: " . PHP_EOL);
            sqlsrv_free_stmt($getResults);
            }
            }
            else
            {
                echo "Data belum berubah";
            }
            ?>

这是我的表格

        <form action='' method='POST'>
        <div class="box-body">
            <div style='overflow:auto;width:1300px;'>
                <table id="example2" class="table table-bordered table-hover">
                    <thead>
                        <tr>
                            <th>my column name</th>
                        </tr>
                    </thead> 
            <?php
            $tampil=sqlsrv_query($conn,'SELECT top 10 * FROM ws_manado ORDER BY Region', array(), array( "Scrollable" => 'static' ));
            $count=sqlsrv_num_rows($tampil);
            if (!$tampil) 
            {
                printf("Error: %s\n", msql_error($conn));
                exit();
            }
            $no=1;
                while ($r=sqlsrv_fetch_array($tampil,SQLSRV_FETCH_ASSOC))
                {
                echo "$count
                <tr>
                    <td id='Id[]' value=$r[Id]>$no</td>
                    <td id='Site_ID_Implementation[]' contenteditable='true'>$r[Site_ID_Implementation]</td>
                    <td id='Implementation_Date[]' contenteditable='true'>$r[Implementation_Date]</td>
                    <td id='PR_Number[]' contenteditable='true'>$r[PR_Number]</td>
                    <td id='PR_Amount[]' contenteditable='true'>$r[PR_Amount]</td>
                </tr>";
            $no++; 
            }
            ?>
                </table>
            </div>
            <input type="submit" name="submit" id="submit" value="submit">
        </div>
        </form>

但是当我点击提交按钮时,我的表格不会更新

0 个答案:

没有答案