Guest Posted March 20, 2006 Posted March 20, 2006 Hi there, I'm trying to get the firstname out of address_book so as I can use it in an email. $firstname = tep_db_query("select entry_firstname from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $affiliate_id . "'"); When I try and include it in my string $body="Dear $firstname"; It produces "Dear Resource id #52" I'm stumped, am I doing something obvious wrong?
kgt Posted March 20, 2006 Posted March 20, 2006 I'm stumped, am I doing something obvious wrong? Yes. Did you look at OSCommerce code to see how this is done? $firstname = tep_db_query("select entry_firstname from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $affiliate_id . "'"); while( $name = tep_db_fetch_array( $firstname ) ) { echo $name['entry_firstname']; } Contributions Discount Coupon Codes Donations
Guest Posted March 20, 2006 Posted March 20, 2006 Did you look at OSCommerce code to see how this is done? No I hadn't lokked at this or understood it when I seen it in the chunk of code and just extracted what I needed and then got very confused. Thank you so much, you have unlocked a bit more of the inner workings of osc for me today. Ally :D
Recommended Posts
Archived
This topic is now archived and is closed to further replies.