tail -f /path/to/php/error.log
должен быть запущен постоянно. И постоянно же должен мониториться. function getAverageRGB(imgEl) {
var blockSize = 5, // only visit every 5 pixels
defaultRGB = {r:0,g:0,b:0}, // for non-supporting envs
canvas = document.createElement('canvas'),
context = canvas.getContext && canvas.getContext('2d'),
data, width, height,
i = -4,
length,
rgb = {r:0,g:0,b:0},
count = 0;
if (!context) {
return defaultRGB;
}
height = canvas.height = imgEl.naturalHeight || imgEl.offsetHeight || imgEl.height;
width = canvas.width = imgEl.naturalWidth || imgEl.offsetWidth || imgEl.width;
context.drawImage(imgEl, 0, 0);
try {
data = context.getImageData(0, 0, width, height);
} catch(e) {
/* security error, img on diff domain */
return defaultRGB;
}
length = data.data.length;
while ( (i += blockSize * 4) < length ) {
++count;
rgb.r += data.data[i];
rgb.g += data.data[i+1];
rgb.b += data.data[i+2];
}
// ~~ used to floor values
rgb.r = ~~(rgb.r/count);
rgb.g = ~~(rgb.g/count);
rgb.b = ~~(rgb.b/count);
return rgb;
}
define('DB_NAME_2', 'putyourdbnamehere');
define('DB_USER_2', 'usernamehere');
define('DB_PASSWORD_2', 'yourpasswordhere');
define('DB_HOST_2', 'localhost');
$seconddb = new wpdb(DB_USER_2,DB_PASSWORD_2,DB_NAME_2,DB_HOST_2);
SELECT movie.name, moviem.year, descriptions.description, categories.name category_name FROM movie
JOIN descriptions ON descriptions.id=movie.descriptions_id
JOIN categories ON categories.id=movie.category_id
SELECT m.name, m.year, d.description, c.name AS category_name FROM movie AS m
echo $row['name'].$row['description'].$row['year'].$row['category_name']."<br>";