Azu Posted June 9, 2007 Share Posted June 9, 2007 Can somebody please tell me how I can change my database so that it will do something else when a certain column is used (which isn't actually in that table)? Like for example so that select `MOO` from `database`.`table` would act like select substring_index(`row`,' ',99)as `MOO` from `database`.`table` ? Quote Link to comment https://forums.phpfreaks.com/topic/54860-do-stuff-instead-of-column/ Share on other sites More sharing options...
obsidian Posted June 9, 2007 Share Posted June 9, 2007 I'm not sure that you'll be able to find anything like that in MySQL. This DB doesn't support functions like PostgreSQL or some other heavier weight database systems do. You may get by with creating a view that contains the definition of the column that you are after and simply selecting the column from the view instead. Hope this helps. Quote Link to comment https://forums.phpfreaks.com/topic/54860-do-stuff-instead-of-column/#findComment-271337 Share on other sites More sharing options...
bubblegum.anarchy Posted June 9, 2007 Share Posted June 9, 2007 SELECT IF (version() >= 5.0, Stored Procedures and Functions, google) Quote Link to comment https://forums.phpfreaks.com/topic/54860-do-stuff-instead-of-column/#findComment-271577 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.