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 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 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' 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. 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
Archived
This topic is now archived and is closed to further replies.