// Escape image data
$escaped = pg_escape_bytea($data);
// The wrong code, which stopped working after Postgres update
pg_query("INSERT INTO gallery (name, data) VALUES ('Pine trees', E'$escaped')");
// The right code
pg_query("INSERT INTO gallery (name, data) VALUES ('Pine trees', '$escaped')");
Joomla 3 LV language pack does not have full support for articles pagination.
The strings that are not translated are in en-GB.lib_joomla.ini file. However, there is nosuch file for Latvian. I had to create lv-LV.lib_joomla.ini, paste contents of appropriate EN file and translate corresponding lines, like: JLIB_HTML_START="Start"
PHP can fail to connect to a MySQL database when a custom port number is specified.
In the old-style you would write like this: $link = mysql_connect("dbhost.info:6603", "dbuser", "dbpaswd",);
Now with mysqli the same approach does not work. $mysqli = new mysqli("dbhost.info:6603", "dbuser", "dbpaswd", "databasename");
If you try to connect this way using mysqli, it will fail with an error Unknow server host ‘dbhost.info:6603’: