我会在示例中解释我需要做什么.首先,我们有一个像这样的简单表,名为table:
id | name
===+=====
1 | foo
1 | bar
1 | foobar
2 | foo
2 | bar
2 | foobar
Run Code Online (Sandbox Code Playgroud)
现在查询:
SELECT t.* FROM table t GROUP BY t.id
Run Code Online (Sandbox Code Playgroud)
会得到类似于这个的结果:
id | name
===+=====
1 | foo
2 | foo
Run Code Online (Sandbox Code Playgroud)
但是有可能收集所有名称的值来得到这样的结果吗?
id | name
===+=================
1 | foo, bar, foobar
2 | foo, bar, foobar
Run Code Online (Sandbox Code Playgroud) 我使用此命令在我的服务器上制作了证书:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt
Run Code Online (Sandbox Code Playgroud)
并且正确配置了所有内容,因为除了http之外输入https时我的网站是可用的.但是有一个问题.我的证书不受信任.
Firefox提示:
sec_error_untrusted_issuer
Run Code Online (Sandbox Code Playgroud)
和Chrome:
NET::ERR_CERT_AUTHORITY_INVALID
Run Code Online (Sandbox Code Playgroud)
有没有办法让我的证书值得信赖?那么错误不会发生?
因为我可以接受风险并转发到网站,但对于通过https访问我的网站的人来说这看起来不太好.
我想改变mu pgsql数据库配置,我想知道他们用什么单位来描述一些值.大多数情况下,我想了解shared_buffers.
如果我的shared_buffers值是例如16384,那它是KB吗?MB?字节?这个值的单位是多少?
我在ZF2中设置标题有问题.我的代码看起来像这样:
public function xmlAction()
{
$headers = new \Zend\Http\Headers();
$headers->clearHeaders();
$headers->addHeaderLine('Content-type', 'application/xml');
echo $file; // xml file content
exit;
}
Run Code Online (Sandbox Code Playgroud)
但标题仍然是text/html.我可以设置正确的标题:
header("Content-type: application/xml");
Run Code Online (Sandbox Code Playgroud)
但我想用Zend Framework做到这一点.为什么上面的代码不起作用?
我有以下函数来加载我的库:
function load_class($name) {
$namePath = explode('_', $name);
$filePath = '';
if (is_array($namePath)) {
for ($i=0; $i<sizeof($namePath); $i++) {
$filePath .= $namePath[$i];
if ($i != sizeof($namePath) - 1) $filePath .= '/';
}
} else $filePath = $name;
if (is_file($filePath . '.php')) require_once($filePath . '.php');
else if (is_file($filePath . '.class.php')) require_once($filePath . '.class.php');
else throw new Exception('Unable to load class: ' . $name . '. No such file or a directory. ');
if (!class_exists($name)) throw new Exception('Class: ' . $name . …Run Code Online (Sandbox Code Playgroud) php ×2
apache ×1
class ×1
group-by ×1
http-headers ×1
linux ×1
oop ×1
openssl ×1
postgresql ×1
sql ×1