duanba8070 2015-02-17 02:36
浏览 80

如何在PHP中从字符串检索数据到文本框?

Good Day Folks,

I have a dynamic text boxes that vary depending on users choice. I can get already its values using this code:

<?php
 $itemCount = count($_POST["process_step"]);
 $itemValues=0;
 $query = "INSERT INTO process (id_ref, process_id, hot_cold, temp) VALUES ";
            $queryValue = "";
            for($i=0;$i<$itemCount;$i++) {
                    if(!empty($_POST["process_step"][$i]) || !empty($_POST["hot_cold"][$i]) || !empty($_POST["temperature"][$i])) {
                        $itemValues++;
                        if($queryValue!="") {
                                $queryValue .= ",";
                        }
                        $queryValue .= "(LAST_INSERT_ID()" . ", '" . $_POST["process_step"][$i] . "', '" . $_POST["hot_cold"][$i] . "', '" . $_POST["temperature"][$i] . "')";
                    }
            }
            $process = $query.$queryValue; //value ng ii-INSERT
        ?>

and the sample output of this is:

INSERT INTO process (id_ref, process_id, hot_cold, temp) VALUES (@ref_id, '1', '', '123')

that I will now use as sql statement to insert in my database.

My problem is this, my form have 4 part, the dynamic text box is at the 3rd form. I have a Back function where in the user can go back to previous forms if they forget or need to edit something. When I was at form 4, when I hit the BAck Button, I cannot fetch back the value of the dynamic textboxes.

any ideas on how??

Thanks

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 oracle集群安装出bug
    • ¥15 关于#python#的问题:自动化测试
    • ¥15 教务系统账号被盗号如何追溯设备
    • ¥20 delta降尺度方法,未来数据怎么降尺度
    • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
    • ¥15 再不同版本的系统上,TCP传输速度不一致
    • ¥15 高德地图点聚合中Marker的位置无法实时更新
    • ¥15 DIFY API Endpoint 问题。
    • ¥20 sub地址DHCP问题
    • ¥15 delta降尺度计算的一些细节,有偿