Showing entries 9061 to 9070 of 44874
« 10 Newer Entries | 10 Older Entries »
High availability read-write splitting with php-mysqlnd, MySQL Replication and HAProxy

MySQL Replication is used in a variety of use cases - scale out read workloads, provide high availability and geographic redundancy, offload backups and reporting/analytic jobs. However it has a big drawback - the application needs to be able to send writes to the master only. Updating more than one master in a replication setup can result in data inconsistency and cause replication to break.

An SQL-aware load balancer like MaxScale could help here, as it could redirect SQL to the appropriate node. If you are using HAProxy and the application is written in PHP, read-write splitting is still achievable with the PHP MySQL native driver with master slave plugin (aka php-mysqlnd_ms). The driver can perform the …

[Read more]
How to generate text representation of an image using PHP?

We will learn how to convert an image to its text representation using PHP that can be used in an html page (if any such requirement arises in your application or just for fun sake :) ).


The steps followed to convert the image to text representation are:

1. Get the width and height of the image to be converted.
2. Loop through every pixel value in the image.
3. At every pixel value, find the color at that position.
4. Apply that color to a # symbol we use to represent that pixel.
5. Finally we get the text representation of the image represented by # (hashes).

Code:

<html>
    <body style="background-color: #000000;">

[Read more]
How to get product using rakuten marketing api in PHP

In this post you can find how can use rakuten linkshare API in our php website first you need to create class for retrieve data from httpspubhelprakutenmarketingcomhcenus website now i give to example of product search but if you use this class then you can easy to implement your other

MariaDB in the Running for 2015 LinuxQuestions.org Members Choice Database of the Year

MariaDB won the 2013 and the 2014 LinuxQuestions.org Members Choice Award Database of the Year, and is in the running again for 2015 winner. Up until 2012, MySQL held a near-monopoly on the title, having won every year since at least 2001 (except for 2002, won by PostgreSQL). Since 2013, however, it’s been all MariaDB, […]

The post MariaDB in the Running for 2015 LinuxQuestions.org Members Choice Database of the Year appeared first on MariaDB.org.

Example of Cron Job in Laravel 5

Whenever you want to define your scheduler task and if you are working on laravel framework then you can do it easy way and very secure Laravel provide strongSchedulingstrong and Scheduling through you can manage your cron if you need to run every day every minute every hourly weekly on

How to get months difference between two dates in Laravel

Whenever you need to get difference between two dates in months in laravel 5 then you can get easily using Carbon Laravel by default provide Carbon class Carbon class throught you can calculate difference between two dates in monthsIn Following example you can see we have a two dates first t

How to get last inserted id in Laravel

Its very common need to get last insert id in programming field if you are working on laravel framework and you want to fetch last created id i mean max id then you do easilylaravel provide method to get last inserted idIf you are working with DBtable then you have to use insertGetId fo

MySQL Community Awards 2016: Call for Nominations!

The 2016 MySQL Community Awards event will take place, as usual, in Santa Clara, during the Percona Live Data Performance Conference, April 2016.

The MySQL Community Awards is a community based initiative. The idea is to publicly recognize contributors to the MySQL ecosystem. The entire process of discussing, voting and awarding is controlled by an independent group of community members, typically based of past winners or their representatives, as well as known contributors.

It is a self-appointed, self-declared, self-making-up-the-rules-as-it-goes committee. It is also very aware of the importance of the community; a no-nonsense, non-political, adhering to tradition, self criticizing committee.

The Call for Nominations is open. We are seeking the community’s assistance in nominating candidates in the following categories:

MySQL Community Awards: Community Contributor of the …

[Read more]
Associating git hooks with php syntax check

Many a times we have faced this problem that when we commit something and it breaks something on the server due to some syntax error.
I know that these can be caught by IDEs and good editors, but sometimes there might be an syntax error introduced after a code merge conflict resolution and commit.
To address this, we can use git pre-commit hooks to check for any syntax errors in the to be committed files.

There is a good script I found which does this at https://github.com/ReekenX/phpcheck-git

Steps to add pre-commit php syntax check with git:

(Issue …

[Read more]
Finding and deleting orphaned rows in MySQL

If you store data with a parent-child relationship in MySQL tables, then you may want to identify and/or delete orphaned rows from the child table. An orphaned row is defined as a child row that references a non-existant parent row. If you enforce the parent-child relationship with a foreign key constraint on the child table then orphans are less likely to occur, but you can still end up with orphans; for example if a user disables foreign_key_checks in a session and deletes a parent row. If you choose not to create foreign keys in your database in order to avoid the performance overhead, then you are at higher risk of having orphaned rows.

Finding orphaned rows

Finding orphaned rows is fairly simple either using an exclusion join or a NOT EXISTS query.

Using the sakila database, here are two queries to …

[Read more]
Showing entries 9061 to 9070 of 44874
« 10 Newer Entries | 10 Older Entries »