How do I completely overwrite previously edited data such that only the latest one is displayed in Codeigniter?

a 夏天 提交于 2020-01-06 23:44:20

问题


I have checked all other related posts but 'could not find any that answers my specific question.

Here's what I have:

<input name="job_id" type="hidden" value="<?= $this->uri->segment(3, 0); ?>" />
<?php foreach ($my_preference as $row) : 

if ( $row['status'] == "Open" ) {

    $bgcolor = "#ADD8E6";
}
else if ( $row['status'] == "Approved" ) {

    $bgcolor = "#8CBEE8";
}
else  {

    $bgcolor = "#EDC2B6";

}
?>

        <span style="font-size: 11pt" class="label label-info"> Proposal</span> &nbsp;&nbsp;&nbsp;
        <strong><?= $row['proposal'] ; ?></strong><br/><br/>
        <span style="font-size: 10pt" class="label label-info"> Job Status</span>&nbsp;&nbsp;&nbsp;
        <strong><?= $row['status'] ; ?></strong><br/><br/>
        <center><a href="<?=site_url()?>/provider/edit_proposal/<?= $row['job_id'] ?>" class="btn btn-primary btn-lg active" role="button">Edit Proposal</a></center>

Currently, this allows me to edit my proposal data. The problem I have is, all the previous data is shown in the page, although whenever I click the "Edit" button, what will be displayed on the textbox is the latest data. My question is, how do I completely overwrite all the previously written (and already edited) data? I want to show only the latest data on the page. I am looking forward to getting any possible help.

Thanks so much and have a great day!


回答1:


make sure your browser is not cached, also type this and see if it shows the data that you want or something else

<pre>
<?php print_r($row); ?>
<?php die(); ?>


来源:https://stackoverflow.com/questions/22751131/how-do-i-completely-overwrite-previously-edited-data-such-that-only-the-latest-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!