News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

address_type and #__users

Started by durian, November 15, 2005, 19:41:31 PM

Previous topic - Next topic

durian

I'm looking at the authorize.net code so I can update my PayFlow Pro module.  Around line 236 in
ps_authorize.php, I see the following code:


        // Get user billing information
        $dbbt = new ps_DB;
        $qt = "SELECT * FROM #__users WHERE id='".$auth["user_id"]."' AND address_type='BT'";
        $dbbt->query($qt);
        $dbbt->next_record();


When I try to use similar code in ps_pfp.php, I get an error stating:
Unknown column 'address_type' in 'where clause'

Looking at other code, I see most address_type accesses are to #__{vm}_user_info, as in the code right below my citation that gathers the shipping address:

            // Get user billing information
            $dbst =& new ps_DB;
            $qt = "SELECT * FROM #__{vm}_user_info WHERE user_info_id='".$d["ship_to_info_id"]."' AND address_type='ST'";
            $dbst->query($qt);
            $dbst->next_record();


Is the code shown above correct (and thus I just have a bug in my own code), or there an error here?

Thanks,
mike

Soeren

Your code correction is ok.
I've changed that in CVS now.

ciao, Soeren
The future of eCommerce: VirtueMart & Joomla!
http://virtuemart.net

buddyq

 :(

Hey so I just found this post and its from 2005?? I turned on DEBUG and upon final checkout got this same error with this code in checkout.confirm.php

$q  = "SELECT * from #__users WHERE ";
$q .= "id='" . $auth["user_id"] . "' ";
$q .= "AND address_type='BT'";
$db->query($q);
if(!$db->num_rows()) {
    $q  = "SELECT * from #__{vm}_user_info WHERE ";
    $q .= "user_id='" . $auth["user_id"] . "' ";
    $q .= "AND address_type='BT'";
    $db->query($q);
}


So, I'm not sure how to fix this error other than getting rid  of the address_type in the first sequence but then $db->num_rows() would be have something... and if I changed the table to be user_info.. then its the exact same code as inside the IF statement. So what's the proper thing to do here? If this post is from 2005, why hasn't this been fixed yet?

Buddy