cyprus Posted September 24, 2006 Share Posted September 24, 2006 Is it permitted/possible to change a select query statement to create an alias name. I tried below but did not work:$query = "select Total as runningtotal from orders"; runningtotal being the table field name, Total as I want to be displayed later. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/21855-using-an-alias-name-in-select-query/ Share on other sites More sharing options...
onlyican Posted September 24, 2006 Share Posted September 24, 2006 SELECT total AS runningtotal FROM ordersmeans when grabbing the data, you grab the fieldname runningtotal NOT total Quote Link to comment https://forums.phpfreaks.com/topic/21855-using-an-alias-name-in-select-query/#findComment-97607 Share on other sites More sharing options...
sasa Posted September 24, 2006 Share Posted September 24, 2006 try 'select runningtotal as Total from orders' Quote Link to comment https://forums.phpfreaks.com/topic/21855-using-an-alias-name-in-select-query/#findComment-97611 Share on other sites More sharing options...
cyprus Posted September 24, 2006 Author Share Posted September 24, 2006 Thanks sasa, that did it!! Regards - Thanks onlyican for reply. Quote Link to comment https://forums.phpfreaks.com/topic/21855-using-an-alias-name-in-select-query/#findComment-97615 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.