lucio Posted June 1, 2007 Share Posted June 1, 2007 Hi there, I recently modified an exsisiting PHP/MySQL website to include an additional field but when I try to use an exsisting function called user_details, it doesn't collect the new field function user_details($id) { $user = array(); $sql = " SELECT u.*, IF(u.first_name!='' AND u.last_name!='', CONCAT(u.first_name, ' ', u.last_name), u.company) AS user_name, b.name AS business_name, wdyfu.name AS where_did_you_find_us_name FROM users AS u LEFT JOIN businesses AS b ON u.business = b.id LEFT JOIN where_did_you_find_us AS wdyfu ON u.where_did_you_find_us = wdyfu.id WHERE u.id='$id' GROUP BY u.id "; $que = mysql_query($sql); if ($que) { $user = mysql_fetch_assoc($que); } return $user; } For other fields in the table, it lets me return them in PHP via <? echo($user['postal_code']) ?> but when I try the same with account in place of postal_code, it fails. I'm completely stuck as to why it's not working! Quote Link to comment https://forums.phpfreaks.com/topic/53855-added-a-field-but-it-doesnt-return-in-a-querry-array/ Share on other sites More sharing options...
fenway Posted June 1, 2007 Share Posted June 1, 2007 What's the in the $user hash? Quote Link to comment https://forums.phpfreaks.com/topic/53855-added-a-field-but-it-doesnt-return-in-a-querry-array/#findComment-266263 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.