The sql statement/string looks ok. The most common reason why queries fail from PHP is an problem with the connection to the server or the syntax of the query statement. How do you know this is not working? Is there an error message? If so, post the error message to get the best help.
One thing that always helps when debugging a problem is to set the error_reporting to tell you everything possible. Place the following near the start of your PHP code -
Could you post your PHP code starting with the statement that connects to the server through to the actual query (xxxxx out any sensitive information such as a password.)