background preloader

Php

Facebook Twitter

Yii Framework

Laravel. Phalcon. PHP Cheatsheets. The "right way" to handle file downloads in PHP - Media Division. Guzzle | PHP HTTP client and framework for consuming RESTful web services — Guzzle documentation. PHP Binding examples. MySql Incremental Backup and Database Restore - TechFlirt.

Mysql Binary Log Configuration and Setup Tutorial - Techflirt. HTML Standard. Nginx and php | can't resolve hostname and make connection with FQDN. CMS. Manage remote databases from localhost with phpMyAdmin - Daniel Mois - Web Developer. Many developers including me use phpMyAdmin to do the database work needed for their projects and this is probably because of it's ease of use and being able to create the needed tables without having to write the SQL statements. I use it because it's fast and it provides all the features I need at this point. Maintenance and debugging apps very often requires you to access and inspect the live database data and a very handy way to do that is to use a tool you probably already have instead of having to login though your hosting company control panel in many cases.

With phpMyAdmin this is disabled by default, but it can easily enabled by modifying the phpMyAdmin configuration file that can be found in it's installation folder. The file config.inc.php contains the configuration settings for your phpMyAdmin installation. It uses an array to store sets of config options for every server it can connect to and by default there is only one, your own machine, or localhost. $i++; Account username. How to sync a MySQL table between two remote databases. | mysql. Definitely tricker than you might think. Seems like it should be trivial using SELECT ... INTO OUTFILE and LOAD DATA INFILE ... to make the transfer via dumping the table into a temporary file. However, SELECT ... INTO OUTFILE creates a file on the remote server rather than locally. Following the guidance in the docs, you can create local dump of a table by using the --execute option to output the results of a SELECT ... statement into a local file. mysql -D database_name -e "SELECT ...

" > /path/to/file.txt This works but has two downsides: First, running a shell command forces you to step outside the MySQL adapter of your progamming language which means it is a new place where the database credentials need to be passed. It's worth noting the mysqldump isn't much help here, as the --tab option that allows CSV output to be generated only works with a local database connection. mysql -h x.x.x.x -u user -D database_name --password=... Here's a quick and dirty PHP implementation: <? Php - how to check and set max_allowed_packet mysql variable. Execute a HTTP POST Using PHP CURL. A customer recently brought to me a unique challenge. My customer wants information request form data to be collected in a database. Nothing new, right? Well, there's a hurdle -- the information isn't going to be saved on the localhost database -- it needs to be stored in a remote database that I cannot connect directly to.

I thought about all of the possible solutions for solving this challenge and settled on this flow: User will submit the form, as usual. In the form processing PHP, I use cURL to execute a POST transmission to a PHP script on the customer's server. The remote script would do a MySQL INSERT query into the customer's private database. This solution worked quite well so I thought I'd share it with you. How would you have solved this problem? PHP/Java Bridge. Using PHP and Java in the Same App with PHP/Java Bridge. As you probably know, PHP 4 supported an extension for combining PHP with Java, but to combine PHP with Java in PHP 5 or PHP 6 you should install the PHP/Java Bridge, which the website describes as: "... an implementation of a streaming, XML-based network protocol, which can be used to connect a native script engine, for example PHP, Scheme or Python, with a Java virtual machine.

" In this article you will learn how to install and configure the PHP/Java Bridge and how to use Java classes in PHP scripts in a demo application. To use the PHP/Java bridge, you should have knowledge of Java SE and the PHP5 core, as well as how they interact. Using the PHP/Java Bridge The current distribution of the PHP/Java Bridge is available for download as a .zip file from the project page. The installation process depends on which Java platform will be interacting with PHP through this bridge. Here's how to install the PHP/Java Bridge for J2EE: The PHP/Java Demo Application Listing FlowerBean.java <? <? <?

Nginx

Security. Dates And Times In Excel. How Excel Stores Dates And Times Excel stores dates and times as a number representing the number of days since 1900-Jan-0, plus a fractional portion of a 24 hour day: ddddd.tttttt . This is called a serial date, or serial date-time. Dates The integer portion of the number, ddddd, represents the number of days since 1900-Jan-0. For example, the date 19-Jan-2000 is stored as 36,544, since 36,544 days have passed since 1900-Jan-0. The number 1 represents 1900-Jan-1. It should be noted that the number 0 does not represent 1899-Dec-31. Actually, this number is one greater than the actual number of days.

Times The fractional portion of the number, ttttt, represents the fractional portion of a 24 hour day. As you can see, any date and time can be stored as the sum of the date and the time. PHP Help Tutorial: PHP Basic Pagination. Basic Pagination As a web developer, you will often be tasked to display large amounts of data to the user in some kind of easy to read format.

Let's say for instance you have a list of employees in your database, and you want to be able to list them on your web page. If you only have a dozen or so employees, it's no big deal to just make a simple loop and display them all on the same page, right? Well what happens when you have 50 employees? 100? 1,000? Pulling out all that data at the same time can leave your user tapping his fingers on the desk wondering what the frak is taking so long, and when he finally does get his info, it's a whole frakking novel on one page! Well anyways, it makes way more sense to break up your list into page-sized chunks, and only query your database one chunk at a time. First things first, you need a table with some data in your database to work with. If you opted to make a new table with that info, here's a quick and dirty script to get it populated: <?

<?