knowram Posted July 30, 2008 Share Posted July 30, 2008 I remember seeing somewhere that you can change the name of the variable you are selecting in the select statement but i can't remember how to do it. something like select DevicePool.Name as DPName so that in the rest of the page I can refer to that variable as DPName not Name. Thanks for the help. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted July 30, 2008 Share Posted July 30, 2008 Your doing it correctly. Usually you would only do that if you had two tables with the same field name and you had to differentiate between the two...or if you were selecting the sum of two fields or something like that. But what your doing should work. Have you tried it? Quote Link to comment Share on other sites More sharing options...
knowram Posted July 30, 2008 Author Share Posted July 30, 2008 hmm here is what I have $iptL = mssql_query("select DevicePool.Name, Device.Description, Device.Name as Mac from DevicePool JOIN Device ON DevicePool.pkid = Device.fkDevicePool JOIN DeviceNumPlanMap ON Device.pkid = DeviceNumPlanMap.fkDevice JOIN NumPlan ON DeviceNumPlanMap.fkNumPlan = NumPlan.pkid WHERE NumPlan.DNOrPattern = '$iptDevice[DNOrPattern]' AND Device.Name NOT LIKE 'ADP%'"); $iptLab = mssql_fetch_array($iptL, MSSQL_ASSOC); then when i try to call on $iptLab['Mac'] i get an error. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 30, 2008 Share Posted July 30, 2008 They're called aliases. I know for a fact that MySQL supports them, but MSSQL may not. Research it a bit. Quote Link to comment 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.