#3515 php changing format when creating view

out-of-date
nobody
5
2013-06-11
2012-02-08
Rick
No

using mysql 5.1.5 ,myphpadmin 2.11.9.6, php 5.3.6

When creating a view in phpmyadmin on yahoo business the select statement changes when attempting to use text. Below are two examples of an If statement and a case statement that return an Integer. Both of these views work correctly. There are also three examples of an If statement to return text and three examples of case statements to return text. None of these six examples work correctly even when using using single quotes, double qoutes or no quotes at all. Please review all of the below examples and let me know what is happening that the select statement changes.

SELECT If(Month(Now())=2,555,999)

works correctly

SELECT case Month(now()) when 2 then 555 else 999 end

works correctly

SELECT If(Month(Now())=2,'Feb','Oth')
changes the select statement to:
SELECT If(Month(Now())=2,\'Feb\',\'Oth\')
and gives error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'Feb\',\'Oth\')' at line 5

SELECT If(Month(Now())=2,"Feb","Oth")
changes the select statement to:
SELECT If(Month(Now())=2,\"Feb\",\"Oth\")
and gives error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\"Feb\",\"Oth\")' at line 5

SELECT If(Month(Now())=2,Feb,Oth)
gives below error:
#1054 - Unknown column 'Feb' in 'field list'

SELECT case Month(now()) when 2 then 'Feb' else 'Other' end
changes the select statement to:
SELECT case Month(now()) when 2 then \'Feb\' else \'Other\' end
and gives error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'Feb\' else \'Other\' end' at line 5

SELECT case Month(now()) when 2 then "Feb" else "Other" end
changes the select statement to:
SELECT case Month(now()) when 2 then \"Feb\" else \"Other\" end
and gives below error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\"Feb\" else \"Other\" end' at line 5

SELECT case Month(now()) when 2 then Feb else Other end
gives below error:
#1054 - Unknown column 'Feb' in 'field list'

Discussion

  • Marc Delisle

    Marc Delisle - 2012-02-08

    phpMyAdmin 2.11.x is no longer supported by the phpMyAdmin team.

     
  • Marc Delisle

    Marc Delisle - 2012-02-08
    • status: open --> closed-out-of-date
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-out-of-date --> out-of-date
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks