Posts tagged ‘php’

Order Posts by Meta Value Numbers in Wordpress

The following changes work on Wordpress version 2.8.*, prior version will need a slightly different change.
A brief background first. I needed to have a page in which my posts were ordered by the meta_values to a particular meta_key. By default meta_value is LONGTEXT data in mysql, therefore we are unable to order posts by meta_value [...]

Creating a PHP Verification Image

You will need to have GD library loaded on your server, and you should be using PHP4+. To check to see if you have either of these running, simply create a file, call it whatever you want, I call mine info.php. Place the following code in there:

1
<? phpinfo(); ?>

If all checks out, then you [...]

Optimizing PHP & SQL

Commonly we see php being used as an interface between the client and the database providing the information. Very few implementations utilize optimization, and thus, reduce performance. Listed below are many techniques that should be used to optimize php to sql communication.

Do not use SELECT * unless you must
Use SELECT priorities for better control
SELECT [...]