小编Bej*_*ols的帖子

MySQL中的"ADD KEY"和"ADD INDEX"有什么区别?

我转储数据库,我有一个问题.这个查询是什么?

ALTER TABLE `ps_cart_rule` ADD KEY `id_customer` (`id_customer`,`active`,`date_to`);
ALTER TABLE `ps_cart_rule` ADD KEY `id_customer_2` (`id_customer`,`active`,`highlight`,`date_to`);
Run Code Online (Sandbox Code Playgroud)

ADD KEYADD INDEX之间的差异是什么?

mysql key alter-table

26
推荐指数
1
解决办法
3万
查看次数

file_get_contents():对等证书不匹配

我使用PHP 5.5,但我不得不更新它,现在我使用的是PHP 5.6.19.

现在,当我尝试与外部API通信时,我收到警告:

警告:file_get_contents():对等证书CN = *.domain.com' did not match expected CN=api.domain.com'

它还没有出现在以前的PHP版本中.

    $encryptedEncodedData // this is json encoded
//array, then encrypted by mcrypt with rijndael-128 and finally bin2hex.

    $context = stream_context_create(array(
                        'http' => array(
                            'method' => 'POST',
                            'header' => 'Content-Type: application/json',
                            'content' => $encryptedEncodedData,
                        )
                    ));

    $api = 'https://api.domain.com/service';

    $response = file_get_contents($api, FALSE, $context);
Run Code Online (Sandbox Code Playgroud)

我不知道这个警告的原因是什么.


我决定禁用peer verfy,直到我的管理员修复了cert的问题,然后我更改了$ context:

$context = stream_context_create(array(
                    'http' => array(
                        'method' => 'POST',
                        'header' => 'Content-Type: application/json',
                        'content' => $encryptedEncodedData,
                        'verify_peer'      => false,
                        'verify_peer_name' …
Run Code Online (Sandbox Code Playgroud)

php

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

如何颠倒媒体查询中元素的顺序?

我有两个div,左边和右边,但是当屏幕小于例如500px时,左边的div变成底部div而右边的div变成顶部div,DOM中的div首先显示为第二个和第二个div.

在此输入图像描述

我使用display: flex,然后divs反转但显示内联并忽略100%宽度.怎么了?

HTML

<div class='nav'>
    <div class='container'>
        <div class='left_bottom'>
            LEFT/BOTTOM
        </div>
        <div class='right_top'>
            RIGHT/TOP
        </div>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS

.nav{
    background-color: red;
}
.container{
    width: 100%;
}
.left_bottom{
    padding: 15px 0 15px 0;
    background-color: green;
    float: left;
    width: 33.33%;
    text-align: center;
}
.right_top{
    padding: 15px 0 15px 0;
    background-color: blue;
    float: right;
    width: 66.66%;
    text-align: center;
}
@media (max-width: 500px){
    .left_bottom{
        float: left;
        width: 100%;
    }
    .right_top{
        float: left;
        width: 100%;
    }
    .container{
        display: flex;
        flex-direction: row-reverse;
    } …
Run Code Online (Sandbox Code Playgroud)

html css css3 flexbox

8
推荐指数
2
解决办法
3081
查看次数

当行被破坏时,CSS将DIV居中

我想在线路断开时设置.container的内容.我不知道如何同时使用float:left和center.我认为这两种都是独特的.

div.container {
  border: solid 1px black;
  text-align: center;
}

div.floatfix:after {
  content: '';
  display: block;
  clear: both;
}

div.item {
  float: left;
  border: solid 1px red;
  padding: 5px;
}
Run Code Online (Sandbox Code Playgroud)
<div class="container floatfix">
  <div class="item">First Item</div>
  <div class="item">Another Item</div>
  <div class="item">Just Another Item</div>
  <div class="item">Middle Item</div>
  <div class="item">Item</div>
  <div class="item">Last Item</div>
  <div class="item">Realy Last Item</div>
</div>
Run Code Online (Sandbox Code Playgroud)

我希望得到如下效果 在此输入图像描述

html css css-float centering

3
推荐指数
1
解决办法
97
查看次数

Prestashop $已记录且$ is_logged

我遇到Smarty的问题,有时在默认代码中发生$ is_logged

.. \模块\ blockuserinfo\blockuserinfo.php

[...]
public function hookDisplayTop($params)
    {
        if (!$this->active)
            return;

        $this->smarty->assign(array(
            [...]
            'is_logged' => $this->context->customer->isLogged(),
            [...]
        ));
        return $this->display(__FILE__, 'blockuserinfo.tpl');
    }
[...]
Run Code Online (Sandbox Code Playgroud)

.. \主题\ Presta的自举\模块\ blockuserinfo \nav.tpl

<!-- Block user information module NAV  -->
{if $is_logged}
    <div class="header_user_info">
            [...]
    </div>
{/if}
Run Code Online (Sandbox Code Playgroud)

但是,只要在$ logp中更改var的名称,它就无法工作.然后它突然起作用了!怎么样?

类似的情况.

.. \主题\ Presta的自举\订单opc.tpl

<!-- Shopping Cart -->

        {include file="$tpl_dir./shopping-cart.tpl"}
        <!-- End Shopping Cart -->
        {if $is_logged AND !$is_guest}
            {include file="$tpl_dir./order-address.tpl"}
        {else}
            <!-- Create account / Guest account / Login block -->
            {include …
Run Code Online (Sandbox Code Playgroud)

php logging smarty prestashop-1.6

2
推荐指数
1
解决办法
7706
查看次数

标签 统计

css ×2

html ×2

php ×2

alter-table ×1

centering ×1

css-float ×1

css3 ×1

flexbox ×1

key ×1

logging ×1

mysql ×1

prestashop-1.6 ×1

smarty ×1