Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Previous 30 Newer Entries Showing entries 91 to 120 of 873 Next 30 Older Entries

Displaying posts with tag: PHP (reset)

Supercharging PHP MySQL applications using the best API
Employee +3 Vote Up -0Vote Down

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?

History  [Read more...]

Power Dynamic Database-Driven Websites with MySQL & PHP
Employee_Team +1 Vote Up -0Vote Down

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.
  [Read more...]
OpenCode: MySQL procedures + python + shell code repositories now public
+1 Vote Up -0Vote Down

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
+0 Vote Up -0Vote Down

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)
+0 Vote Up -0Vote Down

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
+1 Vote Up -0Vote Down

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

  [Read more...]
3 times speed increase with static pages
+0 Vote Up -0Vote Down
Internet was born from static pages. People were creating websites with emacs and vi. With increased popularity of scripting languages and open source databases like MySQL and Postgresql, more and more developers started to use these advanced tools. CMS systems were build. They made our lives much easier. Instead of altering file contents with editor, the user can simply go to the website admin
MySQL, Memcache, PHP revised
Employee +0 Vote Up -0Vote Down

Some time ago I was writing about the InnoDB Memcache Daemon plugin already for the MySQL server. Back then we had a labs release with a little preview only. Meanwhile quite some time passed and new developments were made - just in time for the MySQL 5.6 RC announced this weekend by Tomas.

The innodb_memcache daemon plugin is a plugin for the MySQL Server end contains an embedded memcached. This embedded memcached is configured to use MySQL's InnoDB engine as storage backend. By using this data stored inside an InnoDB table can be accessed using memcache's key-value protocol. Back in the times of the previous blog post this was limited to data from a

  [Read more...]
Configuring Your LEMP System (Linux, nginx, MySQL, PHP-FPM) For Maximum Performance
+0 Vote Up -0Vote Down

Configuring Your LEMP System (Linux, nginx, MySQL, PHP-FPM) For Maximum Performance

If you are using nginx as your webserver, you are looking for a performance boost and better speed. nginx is fast by default, but you can optimize its performance and the performance of all parts (like PHP and MySQL) that work together with nginx. Here is a small, incomprehensive list of tips and tricks to configure your LEMP system (Linux, nginx, MySQL, PHP-FPM) for maximum performance. These tricks work for me, but your mileage may vary. Do not implement them all at once, but one by one and check what effect the modification has on your system's performance.

Top 10 MySQL Tips and Mistakes for PHP Developers (Webinar)
+1 Vote Up -0Vote Down

Tuesday, September 25, 2012

MySQL and PHP are two key components in the open-source LAMP stack, and are widely used by web developers. One day you launched a website, and it gradually gained traction and now serves hundreds times more traffic than day one. As a PHP developer, have you ever looked back and adjusted the MySQL configurations accordingly to meet the most current website load? Have you ever wondered if there are secret tips you might have missed or common mistakes that you could have avoided but never thought of? If you answered yes to either question, this presentation is for you!

In this live webinar, PHP & MySQL experts Ulf Wendel and Johannes Schlüter will share the top 10 tips and mistakes for PHP developers. After a quick overview of lesser known but cool client and server features and plugins, and a recap

  [Read more...]
Installing Apache2 With PHP5 And MySQL Support On OpenSUSE 12.2 (LAMP)
+0 Vote Up -0Vote Down

Installing Apache2 With PHP5 And MySQL Support On OpenSUSE 12.2 (LAMP)

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

RainGauge, the new killer tool ?
+0 Vote Up -0Vote Down

I’m sure you’ve heard of Box Anemometer from the Box (MySQL) team, an excellent UI tool based on pt-query-digest. Now the guys from the box team offer us another killer UI tool based on pt-stalk, and I’m sure you will really appreciate to use it !

What is it ?

 
RainGauge” consists of three parts :

  • A set of scripts that collect data about the health of your system and your databases (based on pt-stalk)
  • A process that push these data on a centralised place
  • A very simple interface to navigate in the collected data
But the collection begins only when specific conditions are triggered, and you choose what these conditions are. Find
  [Read more...]
ConFoo 2013: Call for Papers is Now Open!
+0 Vote Up -0Vote Down

ConFoo is one of the most important web developer-oriented conferences. ConFoo 2013 will be held on February 25 through March 1 in Montreal, Canada.

We just opened call for papers and we are looking for the best PHP, Java, Ruby, DotNet,HTML5 experts who are willing to share their knowledge with the Canadian community. Candidates can submit proposals until September 23. Consult the call for papers page for details and to start submitting. That page also explains what expenses ConFoo can cover for speakers. You can also get advice on how to write proposals.

The call for papers is public, meaning that all proposals get published on the website for others to

  [Read more...]
Y Gatorz are Considering Moving Back to a Gator Farm Instead of MapReducing the World
+0 Vote Up -1Vote Down
NSFW (audio) “…pipe your data to /dev/null – it will be very fast.” “Does /dev/null support sharding?” NSFW (audio) “…the only thing constructive we could have used their source files for was as random keys for SSL certs.” NSFW (audio) “PHP reeks … Continue reading →
Installing Lighttpd With PHP5 (PHP-FPM) And MySQL Support On CentOS 6.3
+0 Vote Up -0Vote Down

Installing Lighttpd With PHP5 (PHP-FPM) And MySQL Support On CentOS 6.3

Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on a Centos 6.3 server with PHP5 support (through PHP-FPM) and MySQL support. PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. I use PHP-FPM in this tutorial instead of Lighttpd's spawn-fcgi.

Installing Apache2 With PHP5 And MySQL Support On CentOS 6.3 (LAMP)
+0 Vote Up -0Vote Down

Installing Apache2 With PHP5 And MySQL Support On CentOS 6.3 (LAMP)

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

PHP for MySQL Striped View
+1 Vote Up -0Vote Down

Back in May I explained how to create MySQL striped views with session variables. A couple folks wanted to know how to implement them through PHP programs. The trick is sharing the same connection between a call to the function before a query against the striped view.

I’ve updated the MySQL example beyond the Hobbit analogy from the prior post. It now uses the following database components:

  • An APPLICATION_USER table
  • A striped AUTHORIZED_USER view
  • A FUNCTION_QUERY view to optimize function calls
  • A SET_LOGIN function
  • A GET_LOGIN_ID function
  • A GET_USER_ID function

The definition of the APPLICATION_USER table is:

  [Read more...]
Free Oracle PHP Book
+1 Vote Up -0Vote Down

Six years ago, I wrote Oracle Database 10g Express Edition PHP Web Programming for the release of the express edition. It was a lot of fun to write because I enjoy the PHP programming language, but unfortunately sales didn’t measure up too well. That’s probably because the population of PHP developers working with Oracle was small.

Today it seems there are more PHP developers working with Oracle 11g. While the population of PHP community for Oracle 11g is still smaller than for MySQL, it continues to grow

  [Read more...]
One-way Password Crypting Flaws
+0 Vote Up -0Vote Down

I was talking with a client and the topic of password crypting came up. From my background as a C coder, I have a few criteria to regard a mechanism to be safe. In this case we’ll just discuss things from the perspective of secure storage, and validation in an application.

  • use a digital fingerprint algorithm, not a hash or CRC. A hash is by nature lossy (generates evenly distributed duplicates) and a CRC is intended to identify bit errors in transmitted data, not compare potentially different data.
  • Store/use all of the fingerprint, not just part (otherwise it’s lossy again).
  • SHA1 and its siblings are not ideal for this purpose, but ok. MD5 and that family of “message digests” has been proven flawed long ago, they can be “freaked” to create a
  •   [Read more...]
    PHP/MySQL Query
    +1 Vote Up -0Vote Down

    Somebody wanted an example of how to handle column values using PHP to query a MySQL database. While I thought there were enough examples out there, they couldn’t find one that was code complete.

    Well, here’s one that works using a static query. If you want to use a prepared statement, check this earlier post.

    <html>
    <header>
    <title>Static Query Object Sample</title>
    <style type="text/css">
      /* HTML element styles. */
      table {background:white;border-style:solid;border-width:3px;border-color:black;border-collapse:collapse;}
      th {text-align:center;font-style:bold;background:lightgray;border:solid 1px gray;}
      td {border:solid 1px gray;}
     
      /* Class tag element styles. */
      .ID {min-width:50px;text-align:right;}
      .Label
      [Read more...]
    Statistical functions in MySQL
    +3 Vote Up -0Vote Down

    Even in times of a growing market of specialized NoSQL databases, the relevance of traditional RDBMS doesn't decline. Especially when it comes to the calculation of aggregates based on complex data sets that can not be processed as a batch like Map&Reduce. MySQL is already bringing in a handful of aggregate functions that can be useful for a statistical analysis. The best known of this type are certainly:

    Read the rest »

    Lock Wait Timeout Errors or Leave Your Data on the Server
    +0 Vote Up -0Vote Down
    If you use MySQL with InnoDB (most everyone) then you will likely see this error at some point. There is some confusion sometimes about what this means. Let me try and explain it.

    Let's say we have a connection called A to the database. Connection A tries to update a row. But, it receives a lock wait timeout error. That does not mean that connection A did anything wrong. It means that another connection, call it B, is also updating a row that connection A wants to update. But, connection B has an open transaction that has not been committed yet. So, MySQL won't let you update that row from connection A. Make sense?

    The first mistake people may make is looking at the code that throws the error to find a solution. It is hardly ever the code that throws the error that is the problem. In our case, it was code that was doing a simple insert into a table. I had a look at our processing logs



      [Read more...]
    Stop comparing stuff you don't understand
    +2 Vote Up -1Vote Down
    I normally don't do this. When I see someone write a blog post I don't agree with, I often just dismiss it and go on. But, this particular one caught my attention. It was titled PHP vs Node.js: Yet Another Versus. The summary was:

    Node.js = PHP + Apache + Memcached + Gearman - overhead

    What the f**k? Are you kidding me? Clearly this person has NEVER used memcached or Gearman in a production environment that had any actual load.

    Back in the day, when URLs and filesystems had a 1:1 mapping, it made perfect sense to have a web server separate from the language it is running. But, nowadays, any PHP app with attractive URLs running behind the Apache web server is going to need a .htaccess file, which tells the server a regular expression to check before serving up a file.






      [Read more...]
    PHP libmysqlclient.so.16 error and MySQL Percona Server 5.5
    +0 Vote Up -0Vote Down

    If you ever get an error with MySQL client library:

    php: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory

    while using Percona MySQL Server 5.5 just go ahead and install Percona-Server-shared-compat package from Percona Repo:

    yum install Percona-Server-shared-compat

    Interviewing tip..
    +0 Vote Up -0Vote Down

    I've been involved in a number of interviews over the last few weeks as a client has been loking for a MySQL DBA. When you are looking for position as a DBA in a large scale environement there are some very important things you have to know.

    You absolutely must know a scripting language. In a smaller environment this often isn't necessary. You will live and die by this in a large environment. I asked every applicant one specific question..if you had to change a mysql server variable on a pool of 100 mysql servers how would you do this? It's easy when it's one,two or even a dozen servers. just log in, change the my.cnf and change it "on the fly" if you can. Restart mysql if you can't.

    You going to do that to 100 servers? It will take all day and be prone to failures. Scripting is the key here. Even just bash shell scripting can be very powerful. In another

      [Read more...]
    UTF-8 with MySQL and LAMP
    +3 Vote Up -0Vote Down

    A recent question on a mailing list was the best practices for UTF-8 and PHP/MySQL. The following are the configurations I used in my multi-language projects.

    MySQL UTF-8 Configuration

    # my.cnf
    [mysqld]
    default_character_set = utf8
    character_set_client       = utf8
    character_set_server       = utf8
    [client]
    default_character_set = utf8
    

    PHP UTF-8 Configuration

    #php.ini
    default_charset = "utf-8"
    

    Apache UTF-8 Configuration

    #httpd.conf
    AddDefaultCharset UTF-8
    <VirtualHost>
        AddCharset UTF-8   .htm
    </VirtualHost>
    

    HTML file UTF-8 Configuration

     <meta charset="utf-8">
    

    PHP file UTF-8 Configuration

    header('Content-type: text/html; charset=UTF-8');
    

    MySQL connection (extra precaution)

    SET NAMES utf8;
    

    Shell UTF-8

    And last

      [Read more...]
    Installing Apache2 With PHP5 And MySQL Support On Ubuntu 12.04 LTS (LAMP)
    +1 Vote Up -0Vote Down

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

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

    jQuery, PHP and CSS.. NetBeans IDE Still Rocks..
    +1 Vote Up -1Vote Down

    Recently, got an opportunity to do some implementation using Ajax and PHP. Having previously used NetBeans IDE 6.1/6.5 for PHP, it was an obvious choice to come back to NetBeans IDE again.

    Although, I am yet to download the latest version, I am currently using 6.8 and I enjoyed every bit of it, while playing with CSS and jQuery for the first time, while implementing Ajax with PHP.

    As I am gonna stay with PHP for sometime now, so I guess I better get my NetBeans IDE upgraded, before I miss out on any useful features.

    It’s good to be back :)


    Filed under: MySQL, NetBeans, PHP, Web
      [Read more...]
    Zend CE has a Worm
    +0 Vote Up -1Vote Down

    After updating the AVGFree virus definitions, I was surprised to find that Zend CE (Community Edition) 4.0.6 had a worm in the JavaServer.exe file. There was greater surprise when Zend CE 5.3.9 (5.6.0-SP1) also had the same worm.

    This is the message identifying the worm (click on it to see a full size image), and you can read about this particular worm on the Mcafee site:

    Unless you have the full version of AVG or another security program to try and fix the file, you can only quarantine the file. Quarantine or removal disables Zend CE from working. It begs the questions,

      [Read more...]
    ImageMagick/PHP: generate center-cropped thumbnails
    +0 Vote Up -0Vote Down

    exec("/path/to/convert -strip -quality 85 -thumbnail 160x100^ -gravity Center -crop 160x100+0+0 +repage '$img_path' '$thumb_path'")

    Previous 30 Newer Entries Showing entries 91 to 120 of 873 Next 30 Older Entries

    Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

    Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.