开发者

How can I auto renew data from MySQL without refresh?

I create dropdown fields to show the data from a MySQL database. Everytime when I key in new data, it must refresh to read the new data. I know Ajax can do it as well. But any other idea to solve this problem without refreshing to get the new data? Just开发者_Go百科 when new data key in, it will auto renew without pressing F5 or refresh.

This is my code:

<th  style="width:25%"><font><div align="left">Select Product :</div></font>
    <?php echo $form->input('Product',array(
        'label'    => 'Select Products',
        'options'  => $products,
        'id'       => 'product',
        'style'    => 'width:250px;height:100px',
        'selected' => $html->value('Product.Product'),
        'onchange' => 'List();')); ?>
</th>
<th >


I think at that point your only option is to get a magical update fairy which performs updates without performing updates.

Seriously though, Ajax isn't that hard for something this simple.


There is such thing as comet. With use of it you can make action to happen in browser by the server side's willing.


The only way to do this without a refresh is with Ajax (httpRequest). There is, of course, the possibility, that you put your select box into an iFrame and refresh only this, but I think that's bad practice. Why wouldn't you use Ajax?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜