Zen Cart Logo
Forums / General Questions / I am getting a division by zero and the logs show two errors which make no sense

I am getting a division by zero and the logs show two errors which make no sense

Views: 821

Results 1 to 7 of 7
14 Sep 2012, 3:38 PM
#1
n8tnu1951 avatar

n8tnu1951

New Zenner

Join Date:
Sep 2012
Posts:
9
Plugin Contributions:
0

I am getting a division by zero and the logs show two errors which make no sense

I get a message when trying to update a customer file. I press update and a page with the message

Error try to refresh the page.
I did this with no results.
when I put my cursor in the address bar at tne end of the url and hit enter, I am taken back to the customer's file.
I went to the log file and found the item below

Division by zero in /home/n8tnu195/public_html/store/includes/functions/functions_general.php on line 1329
and this one
[14-Sep-2012 09:50:50] PHP Fatal error: 1054:Unknown column 'address_book_id' in 'where clause' :: SELECT count(*) AS total
FROM zen_address_book
WHERE customers_id = 1
AND address_book_id = 118 in /home/n8tnu195/public_html/store/includes/classes/db/mysql/query_factory.php on line 101
It appears that something is wrong with address book
Dudley Roth

I have no addons or plugins installed. I just inported some product files from an old osc cart yesterday. Also when I try to make a purchase with the customer I entered, I get the same message

14 Sep 2012, 7:48 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: I am getting a division by zero and the logs show two errors which make no sense

n8tnu1951:

I just inported some product files from an old osc cart yesterday.
Sounds like your import has touched more than just product data, and that you've damaged the database structure for other tables too.

16 Sep 2012, 3:33 PM
#3
n8tnu1951 avatar

n8tnu1951

New Zenner

Join Date:
Sep 2012
Posts:
9
Plugin Contributions:
0

Re: I am getting a division by zero and the logs show two errors which make no sense

My problem seems to be a column name mismatch. In my database, there is a table called zen_address book and the first column says zen.addressbook_id. The other columns in that table do not start with zen and according to host gator support there are about 30 files that use the address book id without the zen prefix. They recommend changing the column name to address book id without the zen. Can that be done? If so, How?
Dudley Roth

16 Sep 2012, 5:57 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: I am getting a division by zero and the logs show two errors which make no sense

The field NAME itself INSIDE the database should be address_book_id -- note the underscores.

DO NOT confuse that with a SQL Query statement which MAY reference the table with something. as a prefix, such as fred.address_book_id.

Sounds like whatever you did to import data from your other store hasn't done its job correctly.

16 Sep 2012, 11:14 PM
#5
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: I am getting a division by zero and the logs show two errors which make no sense

Easiest thing to do would be to restore your database backup (the one you made just before you did your data import) and then inspect your data feed (or SQL insert code) for the conflicting info.

17 Sep 2012, 2:51 PM
#6
n8tnu1951 avatar

n8tnu1951

New Zenner

Join Date:
Sep 2012
Posts:
9
Plugin Contributions:
0

Re: I am getting a division by zero and the logs show two errors which make no sense

Everything is up and running after I renamed a field in the address book table. Thanks
Dudley

17 Sep 2012, 3:31 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: I am getting a division by zero and the logs show two errors which make no sense

You REALLY need to find out WHY that field was wrong in the first place.
It could mean there are other problems too.

Could also be the cause of all the other issues you've posted about in other threads too.