Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2006
    Posts
    3
    Plugin Contributions
    0

    Default [DONE v1.3.0.2] SQL Error: Adding New Address Book Entry as Primary Address

    Hi,

    An SQL error occurs when adding a new address as the primary address to the address book. I looked into this and the error occurs in includes/modules/pages/address_book_process/header_php.php around line 222.

    Replacing the line
    Code:
    $sql_data_array[] = array('fieldName'=>'customers_firstname', 'value'=>$firstname, 'type'=>'string');
    with
    Code:
    $sql_data_array = array( array('fieldName'=>'customers_firstname', 'value'=>$firstname, 'type'=>'string') );
    solves the problem as far as I can tell.

    Initially, $sql_data_array is created to store data for a query that is performed on the address_book table. Once that query is executed, $sql_data_array is reused to execute another query, but this time on the customers table. The problem is that the variable is not reset and still holds data which corresponds to columns in the address_book table - columns which don't match up to the customers table. :)

    Cheers!

    -Kamil

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: SQL Error: Adding New Address Book Entry as Primary Address

    What version of Zen Cart are you using?

    What version of php are you using?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jun 2006
    Posts
    3
    Plugin Contributions
    0

    Default Re: SQL Error: Adding New Address Book Entry as Primary Address

    PHP version 4.4.2
    Zen-cart version: 1.3.0.1

    I was able to reproduce the error on a demo I found here: http://demo.opensourcecms.com/zencart/

    Cheers!

    -Kamil

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: SQL Error: Adding New Address Book Entry as Primary Address

    Check the ID on your /pages/address_book_process/header_php.php

    * @version $Id: header_php.php 3160 2006-03-11 01:37:18Z drbyte $
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jun 2006
    Posts
    3
    Plugin Contributions
    0

    Default Re: SQL Error: Adding New Address Book Entry as Primary Address

    Code:
    @version $Id: header_php.php 3160 2006-03-11 01:37:18Z drbyte $
    Cheers!

    -Kamil

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: SQL Error: Adding New Address Book Entry as Primary Address

    Thanks for the confirmation ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

    Default Re: SQL Error: Adding New Address Book Entry as Primary Address

    Bug confirmed. The posted fix works.

    The correct line number to make the change is line 215, not line 222.

    A variation of this fix will be in the next release (v1.3.0.2).
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jun 2007
    Location
    TN
    Posts
    83
    Plugin Contributions
    0

    Default Re: [DONE] SQL Error: Adding New Address Book Entry as Primary Address

    I have this same issue and I am using 1.3.7.1. My line of code does not look the same and I tried the fix and got a syntax error, so reverted back to what I had before.

    My site is www.swansoninc.com

    If you want to log in and see the error, you can use the e-mail [email protected] and the password 12345

    My line of code was also not on 215 or 222, but it was 209.

    My code looks like this:

    Code:
    $sql_data_array = array( array('fieldName'=>'customers_firstname', 'value'=>$firstname, 'type'=>'string') );
    This is under customer_default_address_id in the code. There is another line that looks the same under new_address_book_id.

    Can anyone offer assistance on this? I am clueless as to what to do next. Thanks.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

    Default Re: [DONE] SQL Error: Adding New Address Book Entry as Primary Address

    The issue discussed in this thread was fixed in v1.3.0.2.

    Further discussion can take place in your other post on the same topic: http://www.zen-cart.com/forum/showthread.php?t=124092
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Replies: 9
    Last Post: 7 May 2016, 06:39 PM
  2. v154 New Address Book Entry Page Doesn't Display the form
    By tk42one in forum General Questions
    Replies: 6
    Last Post: 7 Sep 2015, 02:32 PM
  3. Primary Mailing Address in addition to a Primary Shipping Address
    By southpacific in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 3 Mar 2009, 11:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR