View Site News

Archive for March, 2007

EXTRACT() not working on phpMyAdmin

Posted on: Mar 3rd 2007 | Posted by: Rolan

I was looking at the MySQL manual for Date and Time functions and stumbled upon a function that I might need for an “experiment” I’m doing. I used the function EXTRACT in my query, having my test run on phpMyAdmin, but it was giving me a syntax error warning. I thought that I might have the wrong syntax for EXTRACT so I tried running a sample query, right straight from the manual.

MySQL:
  1. SELECT EXTRACT(YEAR FROM ‘1999-07-02′);

But it still gave me the same error warning. It should be working since its, after all, it was in the manual… otherwise it would be corrected or removed. I ran the same query, but this time the mysql command line. It worked. I executed the query in PHP, it also worked. Well, I think phpMyAdmin is having some problems with this. I’m using phpMyAdmin - 2.8.1, on MySQL 5.0.21 that comes with XAMPP . Maybe I’ll try to ask somebody to test it in other versions.

Filed in: Daily, Reminders, WebDev | | 1 Comment |