Jump to content

Archived

This topic is now archived and is closed to further replies.

cyprus

Using an alias name in select query

Recommended Posts

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

Share this post


Link to post
Share on other sites
SELECT total AS runningtotal FROM orders
means when grabbing the data, you grab the fieldname runningtotal NOT total

Share this post


Link to post
Share on other sites
try 'select runningtotal as Total from orders'

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.