I have to create a query and in that query I need to be able to do this
select if(filename is like .jpg/gif) as type from pictures;
I basically need to send the type of the picture through but they can be either jpg or gif but I don't know the syntax for the if like condition.
tried this and still nothing
select fileType, IF(fileType LIKE '%.jpg' OR fileType LIKE '%.gif', 'jpg', 'gif')from Pictures ......
+-------------------------+--------------------------------------------------------------------+
| Picture | type |
+-------------------------+----------------------------------------------------
| 1554588136_vibsbujy.jpg | jpg |
| 1554626891_powioojt.gif | jpg |
same result both times