Bind Param of PDO Statement Inside Loop

I had a case to use bind parameter of PDO statement inside loop. This was code that I used

[php]
foreach ($this->data as $key => $value) {
$st->bindParam(‘:’ . $key, $value);
}
$st->execute();
[/php]

I executed this code and got surprising result, it didn’t work. Apparently, PDO statement use $value with last looping value. I took a look at PHPDoc for bindParam() and found why this could be happened.
Continue reading

Solution to Error 60 SSL Certificate Problem Verify That the CA Cert is OK

php

I got this SSL error when I want to use a PHP library to access AWS SES. The complete error said

60 SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

I found that it is related to curl setting in php.ini. It needs to know what certificate you use for curl. Because I haven’t define the certificate yet, so this error came up.

Continue reading

Setup RESTful API in Yii2

yii

In this article, I will show you how to setup RESTful API in Yii2 framework. It is a little bit tricky because Yii2 is still in beta release (when this article is written) so the documentation is not complete enough. But don’t worry, this article will give you insight how to setup API in Yii2. Continue reading