我转储数据库,我有一个问题.这个查询是什么?
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 KEY和ADD INDEX之间的差异是什么?
我使用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) 我有两个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) 我想在线路断开时设置.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)
我遇到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)