小编sri*_*inu的帖子

无法更新视图?

我的网站是使用在Ubuntu 11.10上的Postgresql 8.3服务器上运行的Drupal 6开发的.另外webmin版本1.590.

现在我想更新表中的记录,但是当我运行时:

UPDATE uac_institution_view SET status = '2' WHERE nid = '9950'
Run Code Online (Sandbox Code Playgroud)

它给我一个错误,如:

无法执行SQL:SQL UPDATE uac_institution_view SET status ='2'WHERERE nid ='9950'失败:错误:无法更新视图提示:您需要一个无条件的ON UPDATE DO INSTEAD规则.

问题是只有SELECT查询才有效.UPDATE,INSERTDELETE命令不工作; 他们因上述错误而失败.

这是一个问题吗?语法错误?别的什么?

postgresql sql-view sql-update

6
推荐指数
3
解决办法
2万
查看次数

如何在smarty .tpl文件中调用php函数?

嗨,我已经在.php文件中编写了一个函数.即

public static function getCategories($id_lang = false, $active = true, $order = true, $sql_filter = '', $sql_sort = '',$sql_limit = '')
{
    if (!Validate::isBool($active))
        die(Tools::displayError());

    $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
        SELECT *
        FROM `'._DB_PREFIX_.'category` c
        LEFT JOIN `'._DB_PREFIX_.'category_lang` cl 
        ON c.`id_category` = cl.`id_category`
        WHERE 1 '.$sql_filter.' '.($id_lang ? 'AND `id_lang` = '.(int)($id_lang) : '').'
        '.($active ? 'AND `active` = 1' : '').'
        '.(!$id_lang ? 'GROUP BY c.id_category' : '').'
        '.($sql_sort != '' ? $sql_sort : 'ORDER BY c.`level_depth` ASC, c.`position` ASC').'
        '.($sql_limit …
Run Code Online (Sandbox Code Playgroud)

php smarty prestashop

5
推荐指数
2
解决办法
3万
查看次数

在谷歌地图中获取标记ID

我想通过点击谷歌地图上的标记来传递相关的标记ID.我正在使用marker.getId()函数来检索标记ID.但标记ID不与url一起传递.我怎样才能做到这一点?任何帮助?

function AddressMap(lat,lang,markerid)
{   
var latLng = new google.maps.LatLng(lat,lang);
var marker = new google.maps.Marker({
    'map': map,
    position: latLng,
    'latitude' :lat,
    'longitude' :lang,
    icon: image,
    shadow: shadow,
    id: markerid

});

markers.push(marker);   
google.maps.event.addListener(marker, 'click', function() {               
          window.location = "www.cickstart.com/" + marker.getId();

        }); 
}
Run Code Online (Sandbox Code Playgroud)

google-maps

4
推荐指数
2
解决办法
3万
查看次数

如何在运行时检查复选框

如果在运行时使用javascript的id或值为2,我想将复选选项添加到复选框.我尝试使用以下代码,但我无法选中复选框.有任何想法吗?

<div>
        <h4>Filter by Area</h4>             
            <ul id="arealist">
    <li><input type ="checkbox"  id="1" value="1" /> All</li>
    <li><input type ="checkbox"   id="2" value="2" /> some</li>
    <li><input type ="checkbox"   id="3" value="3" /> heavy</li>
    <li><input type ="checkbox"   id="4" value="4" /> more</li>
    <li><input type ="checkbox"   id="5" value="5" /> none</li>

                                            </ul>   </div>
<script type="text/javascript" src="<?=base_url()?>js/jquery-1.6.4.min.js"></script>    
<script type="text/javascript">
$(document).ready(function(){  
var areaname=2; //this value i am getting at run time.
$("#areaname").prop("checked",true);
});
</script>
Run Code Online (Sandbox Code Playgroud)

javascript jquery

0
推荐指数
1
解决办法
1389
查看次数