Fatal error: Call to undefined function mysqli_connect_error()

The reason is the mysqli.dll is disabled in php.ini file. Open the phpinfo and find ... the configuration file Edit the file and find the following line ;extension=php_mysqli.dll Remove ... the comment. And then restart Apache server. Check the phpinfo again and find mysqli support ... The error will not occur again.

When not to suppress fatal errors with @ in PHP

In PHP the @ is used to suppress warning or error messages, but it has some serious drawbacks ... the @ operator, you can see the error in the response <b>Fatal error</b>: Call to undefined function ... in PHP configuration file. [It breaks AJAX response] If you specified the response format ... of AJAX as JSON, when a fatal error happens, the server will be interrupted and returns ahead of time

How to debug AJAX response in PHP

The simplest way to debug a normal PHP request is using the echo to output messages ... to browser, but in AJAX, it's not working. In an AJAX request, the response usually was not displayed ... the AJAX response is received and check its value in your debugger for example in Chrome Developer Tools. ... . Without other facilities, the only way to debug it is to set the breakpoint at the place where

CURL download speed is very slow on PHP Apache server

I have a service running on Apache server that use curl php to retrieve web pages ... . For unknown reasons, I notice that the download speed gets very slow. But it's not normal, since I issues ... ://www.google.com/search?q=curl+download+speed+slow+speed_download&newwindow=1&ei=2txxWN-KMMK00gSa1ZqQDg&start=10&sa ... , not only the download speed is slow, but also the DNS lookup time. DNS lookup took 13.1 seconds

PHP array_multisort two arrays sort by column example

A common problem we run into in day to day PHP programming is to sort two arrays by one ... column. Especially when the data comes from database. We sometimes need to write code to do the things ... from table order by a desc; SQL is a declaration language and good at such tasks, PHP is an imperative ... . There are several ported LINQ for PHP, check them out if you want to save your precious time

How to use CURL examples and tutorials

('error-curl.txt'); But you can read the file after the function that create and use the curl ... ::: Network is unreachable] The reason of network is unreachable can be the curl tries to use IPv6 ... [How to debug curl with CURLOPT_STDERR and CURLOPT_VERBOSE] Step 1, enable verbose ... mode in curl curl_setopt($ch, CURLOPT_VERBOSE, true); If the problem is connection timeout, you may

Use a plugin pattern in PHP instead of global variable

call it polymorphism. Its tempting to abuse a global variable in PHP to implement it. Declare ... is a solution I used to solve the global variable issue. [Instead of overwrite global variable, we ... . Using a global variable will be a disaster, the abstractions will leaks everywhere. Here ... can use a plugin] A plugin is an implementation can be plugged into a predefined place. And its

Call to undefined function mysql_connect

The reason of the problem is PHP didn't load php_msql.dll correct. Here is how to solve ... the problem. Print the output of phpinfo and search for Loaded Configuration File, and locate ... the configuration file: Open the file with your editor and search for extension_dir Make sure ... the path is right, usually it should point to ext directory of your PHP installation.

PHP date function

For example, I want date in this format

Use format string "Y-m-d"


format. preg_match('/line1\r\ntheme_name:([\s\S]*?)\r\nline3/', $text, $matches); The matches ... Match text between two lines, suppose we have three lines of text line1 theme_name:theme1 ... line3 We want to extract out the theme name, here the "theme1" string. We use windows line ending ... will looks like Array ( [0] => line1 theme_name:theme1 line3 [1] => theme1 )
1 2 ... 5 Next Page