Showing entries 121 to 130 of 910
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: PHP (reset)
Some sharding support and cache locality optimization support for PHP MySQL driver

It is time for christmas presents: some sharding support and cache locality optimizations are coming with PECL/mysqlnd_ms 1.5. PECL/mysqlnd_ms is a plugin for the mysqlnd library. The plugin adds replication and load balancing support to any PHP MySQL API (mysql, mysqli, PDO_MySQL) if compiled to use the mysqlnd library.

As a MySQL user you can choose between a wide variety of clustering solutions to scale-out. Your options range from eventual consistent solutions to strong consistent ones, from built-in (MySQL Replication, MySQL Cluster) to third party or home-grown. PECL/mysqlnd_ms is a client side load balancer that aims to serve all. …

[Read more]
Switching to PHP 5.4 on OS X

I like using OS X's built-in packages where possible, but unfortunately Apple is way behind with their PHP package, having it locked on 5.3.15. In the past I've seen people use tools like Mamp, or Xampp to provide this for them, but frankly I'm not a big fan of these tools.

Homebrew provides a solution. Homebrew is OS X missing package manager, and it's an absolute great tool to work with. Getting started with it is a bit harder, as there's a few bigger dependencies you need, such as an up-to-date XCode installation. Once you've installed homebrew, it's a matter of running the following commands:

  1. brew tap homebrew/dupes
  2. brew tap josegonzalez/homebrew-php
  3. brew install php54 --with-mysql
[Read more]
Prevent SQL Injection in PHP

Two easy ways to prevent SQL Injection in PHP

To many people still execute sql queries using methods which does not prevent SQL Injection, and many tutorials out there give bad example of doing so.

SQL Injection? What? -> SQL Injection explained

There are two easy aproachs to prevent SQL Injection:

  1. Using PDO:
    stmt = $pdo->prepare('SELECT * FROM employees WHERE name = :name'); 
    $stmt->execute(array(':name' => $name)); 
    foreach ($stmt as $row) {     
        // do something with $row 
    }
    
  2. Using mysqli:
    $stmt = $dbConnection->prepare('SELECT * FROM employees WHERE name = ?'); 
    $stmt->bind_param('s', $name); 
    $stmt>execute(); 
    $result = …
[Read more]
Learn to Create Applications Using MySQL with MySQL for Developers Course

If you are a database developer who wants to create applications using MySQL, then the MySQL for Developers course is for you. This course covers how to plan, design and implement applications using the MySQL database with realistic examples in Java and PHP.

To see more details of the content of the MySQL for Developers course, go to http://oracle.com/education/mysql and click on the Learning Paths tab and select the MySQL Developer path.

You can take this course as a:

  • Live-Virtual Event: Follow this live instructor-led event from your own desk - no travel required. Choose from a selection of events on the calendar in languages such as English, German and Korean.
  • In-Class Event: Travel to an education center to take this class. Below is a sample of events on the schedule.

 Location …

[Read more]
Supercharging PHP MySQL applications using the best API

PHP MySQL developers are confronted with three PHP MySQL APIs. That is confusing. Since mid 2012 the PHP manual suggests not to use the oldest and original PHP MySQL extension any more to cure the situation. Please, swap out ext/mysql in favour of either ext/mysqli or PDO_MySQL. Why to upgrade is below. Read on, if you are a PHP beginner, your PHP application is still using mysql_* functions of ext/mysql or you are a PHP trainer.

As a PHP consumer, tease your software vendors by asking whether they use the state of the art APIs! Here is a cut&paste test question to ask your vendor: do you support secure SSL connections to MySQL?

[Read more]
Power Dynamic Database-Driven Websites with MySQL & PHP

Join major names among MySQL customers by learning to power dynamic database-driven websites with MySQL & PHP.

With the MySQL and PHP: Developing Dynamic Web Applications course, in 4 days, you learn how to develop applications in PHP and how to use MySQL efficiently for those applications! Through a hands-on approach, this instructor-led course helps you improve your PHP skills and combine them with time-proven database management techniques to create best-of-breed web applications that are efficient, solid and secure.

You can currently take this course as a:

  • Live Virtual Class (LVC): There are a number events on the schedule to suit different timezones in January 2013 and March 2013. With an LVC, you get to follow this live instructor-led class from your own desk - so no travel expense or inconvenience.
  • In-Class Event: Travel to an education center to attend this class. Here are …
[Read more]
OpenCode: MySQL procedures + python + shell code repositories now public

I write a fair number of scripts on this site and have posted a lot of code over the years. Generally if I am not pasting the code to be viewed on the webpage then I link to a file that a user can download; which leads to a lot of mish-mash code that doesn’t have a home. I’ve always kept the code files in a private SVN repo over the years but have recently moved them all to BitBucket Git repositories. So here they are: lots of code samples and useful bits of programming to save time.

Generic Shell Scripts: https://bitbucket.org/themattreid/generic-bash-scripts/src
Generic Python Scripts: https://bitbucket.org/themattreid/generic-python-scripts/src
Generic MySQL Stored Procs: …

[Read more]
Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support (LEMP) On Ubuntu 12.10

Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support (LEMP) On Ubuntu 12.10

Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on an Ubuntu 12.10 server with PHP5 support (through PHP-FPM) and MySQL support (LEMP = Linux + nginx (pronounced "engine x") + MySQL + PHP).

Installing Apache2 With PHP5 And MySQL Support On Ubuntu 12.10 (LAMP)

Installing Apache2 With PHP5 And MySQL Support On Ubuntu 12.10 (LAMP)

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on an Ubuntu 12.10 server with PHP5 support (mod_php) and MySQL support.

Using lookup tables

My students wanted an example of how to use a lookup table in the database. I thought it would be a great idea to create a simple example like this one.

A lookup table is a generalization that holds lists of values that support end-user selections. The following example uses a combination of the common_lookup_table and common_lookup_column columns to identify sets of value for drop down lists. The end-user selects a value from the list to identify a unique row, and returns a common_lookup_id surrogate key value.

The sample code uses the table defined in the previous illustration. It uses a simple HTML drop down list, a PHP library.inc file, and an HTML display form. Below is the drop down selection set for a table and column value.

[Read more]
Showing entries 121 to 130 of 910
« 10 Newer Entries | 10 Older Entries »