Export a MySQL Table to a Tab-Separated TXT File With PHP (PDO) or the Command Line

The old mysql_* export script no longer runs on PHP 7 or 8. Here is a PDO version that streams large tables safely, plus a one-line command-line alternative.

The old mysql_* export script no longer runs on PHP 7 or 8. Here is a PDO version that streams large tables safely, plus a one-line command-line alternative.

$(window) gives you the visible viewport, $(document) gives you the whole page. Here is what each call returns, the plain JavaScript versions, and how to react to resizing.

Mobile redirects made sense when phones could not render full sites. Today a responsive site is simpler and safer. If you must redirect, here is how to do it without hurting SEO.

A cast handles simple objects, json_encode and json_decode handle nested ones, and WordPress has its own helpers. Here is when to use each, and the private property gotcha.

Setting a folder to 777 makes uploads work, but it also lets any process on the server write there. On most hosts 755 for folders and 644 for files is all you need.

Files that start with a dot are hidden by default, so .htaccess often seems to be missing. Here is the setting that shows it in each common FTP client and file manager.

If FCKeditor says an image uploaded but nothing appears, check paths and permissions. Then plan to replace it, because its file connector is a common way sites get hacked.

Some actions only redirect, stream a file or echo a value, and do not need a template. Here is how to stop CakePHP from looking for one in each version.

Removing index.php can mean two things: redirecting /index.php to / so there is one canonical URL, or routing clean URLs through index.php behind the scenes. Here are rules for both.

join(), toString() and JSON.stringify() all turn an array into a string, but only one keeps your data intact on the way to PHP. Here is when to use each.