Latest

Sony VGN-FE21B Memory Stick fix for Windows XP

My Sony VGN-FE21B laptop has been having problems with performance over the last few months, applications were taking a long time to load and the hard drive was getting cluttered with obsolete files, so at the weekend I decided to re-install Windows XP Pro onto my Sony VGN-FE21B laptop.

The original operating system was Windows XP Home but since the laptop has been bought primarily for work purposes, I had also bought a copy of Windows XP Pro but each time I install Windows XP Pro on my Sony VGN-FE21B laptop it always has a missing icon for the memory stick in My Computer. I imagine this is because the hardware is specific to Sony and not a generic Windows XP driver.

Read more

mysqldump on Windows gives "Access is Denied"

I recently had to back up a MySQL database on a windows server so I could restore it to my local MySQL server for analysing the structure of an existing site which we are going to be rebuilding. I have done this hundreds of times on linux server but the usual command did not appear to work on this windows server. I was using:-

but when I ran this I was presented with an "Access Denied" message.

Read more

Wordpress wp_redirect() shows a blank page

Over the last few weeks I have been working on my first wordpress plugin and I am quickly getting to grips with how it all pieces together but I ran into a problem with a rather basic piece of functionality that pretty much rendered the plugin useless until I figured out the issue.

The section I was working on was a form submission (within the wordpress administation) which saved the form values into the database and then redirected the user upon success to another page (using wp_redirect) but this resulted in a blank content pane.

Read more

User Profile Service Failed the Logon

This Christmas was the quietest Christmas I have had in years in terms of the obligatory "if you have got the time" IT jobs as I only had 1 request for fixing a computer this year (instead of the 4 computers and a DVD player I had a few years back... all requested within 2 hours of arriving home).

Luckily this one turned out to be relatively simple and only took 5 minutes to fix although when I first heard about it I thought it was going to take a few hours. My aunt and uncle reported a problem with logging into their laptop (running Windows Vista Home Premium) on my uncle's profile where it would give an error message "The User Profile Service failed the logon", after which it would simply return them to the profile selection screen.

Read more

Raw SQL from Doctrine Query Object - Revised

A few months ago I posted an article taking about how to get the raw SQL from a Doctrine Query Object but with the release of Symfony 1.3 and Symfony 1.4 it would appear that the code no longer works.  As a result I've updated the code to work with Symfony 1.2 - 1.4 and you can find the updated source below:-

function get_raw_sql($query) {
    if(!($query instanceof Doctrine_Query)) {
        throw new sfException('Not an instanse of a Doctrine Query');
    }
 
    $query->limit(0);
    
    if(is_callable(array($query, 'buildSqlQuery'))) {
        $queryString = $query->buildSqlQuery();
        $query_params = $query->getParams();
        $params = $query_params['where'];
    } else {
        $queryString = $query->getSql();
        $params = $query->getParams();
    }
 
    $queryStringParts = split('\?', $queryString);
    $iQC = 0;
 
    $queryString = "";
    
    foreach($params as $param) {
        if(is_numeric($param)) {
            $queryString .= $queryStringParts[$iQC] . $param;
        } elseif(is_bool($param)) {
            $queryString .= $queryStringParts[$iQC] . $param*1;
        } else {
            $queryString .= $queryStringParts[$iQC] . '\'' . $param . '\'';
        }
 
        $iQC++;
   }
   for($iQC;$iQC < count($queryStringParts);$iQC++) {
       $queryString .= $queryStringParts[$iQC];
   }
 
    echo $queryString;
}

I hope that it proves useful.

Read more

TRUNCATE TABLE with Symfony and Doctrine

I am often importing data into a symfony project from an existing site or a CSV file and re-writing this data into the fixtures.yml is usually too complicated or time consuming so I end up writing bespoke import actions.

While I am writing these actions I often find that I have to delete the contents of the MySQL tables as you can never write the routine complete and accurate in one go so as you build it up in smaller steps you find that you have to get rid of the previously old data.

Read more

Magento API - Update Product Stock Levels

Another day... another magento problem!

I was asked to look into a problem with an automated stock level update script not updating the stock levels.  This update script was using the Magento API and on the face of things everything looked ok as the script ran without any errors, the product prices got updated but the stock levels never changed.

Read more

Raw SQL from a Doctrine Query Object

As my use of Symfony is increasing I find myself frustrated that there doesn't appear to be an easy way to get the raw SQL from a doctrine query object so I can simply output it and paste it into phpMyAdmin to debug problems with the SQL. I may be wrong about this but as yet I have not found a built in function to perform this operation.

Sure I am able to output the query with the "?" indicating where the necessary values are to go and I can also easily output the array of query parameters so I can substitute these manually but this takes time and it would be much much simpler and quicker to just output the whole query with the substitution already done so it's a simply copy and paste of the raw SQL from the doctrine query object straight into phpMyAdmin.

Read more

Why you should answer your own posts?

How many times have you searched for the answer to a problem in Google to find nothing but forums with people who have the same questions but no solutions posted even though the question was raised months, even years earlier?

If you post a question and no-one managed to provide you with an answer do you:-

Read more

Symfony - Does not have a registered handler

Last week I was working away in the office at Line Digital on our latest Symfony based project when our project started giving us a strange error similar to:-

Looking into this a little closer we found that the server had ran out of disk space so after making some space and using "symfony cc" to clear the cache we thought that this would have resolved the problem, however we continued to get the "does not have a registered handler" message being presented.

Read more

Reading List

Medium

Medium

How a single change boosted organic traffic by 40%

How a single change boosted organic traffic by 40%

The SEO world can sometimes be a confusing maze of contradictions. Read more

Louder Than Ten

Design machines

Design machines

A dystopian view of an internet designed by machines, and the mushy, emotional weapons we can use to fight back. Read more

verraes.net

verraes.net

Sensible Interfaces

Sensible Interfaces

How did we get from 'Program to an interface, not to an implementation' to 'Just slap an interface on there, it's the fashionable thing to do'? Read more

Moz

Moz

The Linkbait Bump: How Viral Content Creates Long-Term Lift in Organic Traffic - Whiteboard Friday

The Linkbait Bump: How Viral Content Creates Long-Term Lift in Organic Traffic - Whiteboard Friday

A fantastic piece of content can lift your traffic curves to a "new normal." In today's Whiteboard Friday, Rand talks about exactly how that happens, and how you can create content that has that effect. Read more

Loige

Loige

6 Rules of thumb to build blazing fast web applications (server side)

6 Rules of thumb to build blazing fast web applications (server side)

In this post are described 6 extremely important rules you should take under consideration when writing your next web application Read more

SitePoint

SitePoint

Console Wars - PHP CLI Libraries

Console Wars - PHP CLI Libraries

Nicola Pietroluongo compares three popular PHP console libraries, building the same functionality in each. Wondering which one is right for you? Find out! Read more

Advertisement

Digital Ocean