I asked following question in my training to explain some point.
Answers Received :
One question and multiple answers ! The right answer is “Hello Jhon” . Does it tickle your brain? why ! .
Please notice there is no single quote around string index – “Message” in $arr[Message] . And, “Message” is a defined constant which is initialized to “name” and $arr['name'] is Jhon .
Above example explains why we should always provide single quotes to string index.
Recently , I came across with following error on a CentOS6 machine on my colleague’s machine.
The mysqli extension is missing. Please check your PHP configuration…
As I was sure about my installation I started looking for a possible fix on google. I checked the output of phpinfo () and found there is no lib related to mysqli. After trying all option and no luck I thought of trying from starting hence I run following command in terminal.
php -m | grep -i mysqli
I noticed I don’t have mysqli install !. Run following command
yum install php-mysql
It will install the “php-mysql” as per repository set on CentOS.
service httpd restart
service mysql restart
Refresh the url http://localhost/phpmyadmin page received a pop up to enter username/password ..but with some reason at my end password was incorrect so I did following
mysqladmin -u root password NEWPASSWORD
This time it worked for me .