Author Topic: Fatal error: Call to a member function numRows() on a non-object in  (Read 13966 times)

daydreamer

  • Guest
I'm running WB on localhost installed bakery and getting this error

Fatal error: Call to a member function numRows() on a non-object in /Applications/AMPPS/www/test/baker/modules/bakery/modify.php on line 52

Anyone had this issue or know what the problem is please?

Offline freeSbee

  • Moderator
  • ***
  • Posts: 1114
    • BAKERY - Website Baker shop module
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #1 on: November 12, 2013, 02:22:27 PM »
Hi daydreamer

Have a look into your database table mod_bakery_general_settings, if the fields shop_name, display_settings are present…

Regards Christoph

daydreamer

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #2 on: November 12, 2013, 02:29:57 PM »
Strange mod_bakery_general_ settings not in thae database but all other tables are  :?

daydreamer

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #3 on: November 12, 2013, 03:38:58 PM »
I'm using Ampps, tried with mamp and it works  :?

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4022
  • Gender: Male
    • Webdesign und Entwicklung WebsiteBaker
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #4 on: November 12, 2013, 05:02:43 PM »

Quote
Fatal error: Call to a member function numRows() on a non-object in /Applications/AMPPS/www/test/baker/modules/bakery/modify.php on line 52

Check the syntax from your sql statement, Most of them solve your issue

Dietmar
Eric T. Hansen, amerikanischer Buchautor „Nörgeln des Deutschen größte Lust"
Neues Unwort: Schnappatmung

daydreamer

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #5 on: November 12, 2013, 09:29:45 PM »
Thanks Luisehahne,

I can't find a syntax error this is the bakery sql

Code:
Only registered users can see contents. Please click here to Register or Login.

jacobi22

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #6 on: November 12, 2013, 10:33:31 PM »

Quote
Fatal error: Call to a member function numRows() on a non-object in /Applications/AMPPS/www/test/baker/modules/bakery/modify.php on line 52

Check the syntax from your sql statement, Most of them solve your issue


its not a syntax error, its a result from a empty select -> see the post from freeSbee
Code:
Only registered users can see contents. Please click here to Register or Login.

daydreamer

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #7 on: November 12, 2013, 11:19:50 PM »
Thanks jacobi22  :-D

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4022
  • Gender: Male
    • Webdesign und Entwicklung WebsiteBaker
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #8 on: November 12, 2013, 11:43:39 PM »
Hallo,

There was a missunderstanding. I don't mean the sql Backup.

Seems to be a wrong call for NumRows(). In my point you forgot the object before NumRows()

Is the old way to code.

Code:
Only registered users can see contents. Please click here to Register or Login.
Dietmar

 
Eric T. Hansen, amerikanischer Buchautor „Nörgeln des Deutschen größte Lust"
Neues Unwort: Schnappatmung

daydreamer

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #9 on: November 13, 2013, 09:59:42 PM »
For some reason when installing bakery the table mod_bakery_general_ settings is not installing as it is missing from the database.

Thanks for all the help :)

daydreamer

  • Guest
Found the problem

Code:
Only registered users can see contents. Please click here to Register or Login.
Would not drop mod_bakery_general_ settings

Changed to

Code:
Only registered users can see contents. Please click here to Register or Login.
and all works as normal

Not sure if this is an issue with mysql & Ampps

jacobi22

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #11 on: November 14, 2013, 08:59:02 AM »
please try to change this value in the bakery backend settings...

daydreamer

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #12 on: November 14, 2013, 11:44:25 AM »
I can change to 9999999 from general settings with no issue

jacobi22

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #13 on: November 14, 2013, 12:51:54 PM »
I can change to 9999999 from general settings with no issue

crazy  :lol:
(but i dont unterstand, why it makes problems with 99999 or more

daydreamer

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #14 on: November 14, 2013, 03:22:58 PM »
I have no idea, pleased I found the issue it was driving me crazy

Offline dbs

  • Betatester
  • **
  • Posts: 6893
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #15 on: December 13, 2013, 12:36:17 PM »
The same problem here.
Code:
Only registered users can see contents. Please click here to Register or Login.
New install of Bakery in Portable 2.8.3 (PHP 5.4.)
No table mod_bakery_general_ settings was created.
After changing in install.php line 173 from '9999999' to '999' and installing again (Add-Ons > Modules > Advanced) it works.

jacobi22

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #16 on: December 13, 2013, 02:56:23 PM »
bei mir in der selben Konstellation ohne Probleme  :roll:
vielleicht ist es geschickter, diesen Wert (99999,99) erst in der add.php hinzuzufügen(?)

oh, english thread, sorry   :-o

work for me on the same situation (actual wb-portable-version with the sme php- and mysql, and bakery version) without problems
maybe its better, to set the default value not in the installer, set the value "99999.99" as a INSERT in the add.php
« Last Edit: December 13, 2013, 03:37:25 PM by jacobi22 »

Offline marmot

  • Posts: 1103
Hi,

Code:
Only registered users can see contents. Please click here to Register or Login.
No table mod_bakery_general_ settings was created.
After changing in install.php line 173 from '9999999' to '999' and installing again (Add-Ons > Modules > Advanced) it works.
at this point I can use my unique ability to use google and to read a manual. "DECIMAL(7,2)" means 7 digits including decimals, which means the intger part can have 5 digits maximum = 99999. Fine if it works with a 7 digit integer soemtimes but it's not according to the field definition.

regards

jacobi22

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #18 on: December 13, 2013, 03:30:09 PM »
in the scool i learning this: a decimal has three parts: 1. integer part 2. decimal point like comma or point, 3. fractional part
in the manual i found this:  A packed “exact” fixed-point number. M is the total number of digits (the precision) and D is the number of digits after the decimal point (the scale).
so i unterstand: M is the precision (for mathematic operations), and D is the output, but not: m is the total sum of all digits on the left and the rights side from the decimal point

i found more informations on the next page in the manual
Quote
For example, a DECIMAL(18,9) column has nine digits on either side of the decimal point, so the integer part and the fractional part each require 4 bytes. A DECIMAL(20,6) column has fourteen integer digits and six fractional digits. The integer digits require four bytes for nine of the digits and 3 bytes for the remaining five digits. The six fractional digits require 3 bytes.
its exactly this, was marmot write

but i dont unterstand, why it's work for me and not for dbs with the same configuration (same wb-portable with same php- and mysql version)

german translation....
wohl ein "Verständnisproblem" mit mathematischen Bezeichnungen. Ich hatte das noch so gelernt, das vor dem Trenner eine Ganzzahl steht, hinter dem Trenner die Dezimalzahl.

lt Definition MySQL: DECIMAL[(M[,D])] - Gepackte „exakte“ Festkommazahl. M ist die Gesamtzahl von Dezimalstellen (Genauigkeit), D die Anzahl der Stellen hinter dem Dezimalpunkt.

heißt bei mir, es wird auf 7 Nachkommastellen berechnet, auf 2 gerundet bzw 2 ausgegeben

liest man an anderer Stelle weiter, heißt es aber: Da beispielsweise die Spalte DECIMAL(18,9) auf jeder Seite des Dezimalpunkts 9 Stellen hat, belegen ihr ganzzahliger und ihr Dezimalteil jeweils 4 Byte. Eine DECIMAL(20,10)-Spalte hat dagegen auf jeder Seite des Dezimalpunkts 10 Stellen. Jeder Teil belegt also 4 Byte für die ersten 9 Stellen und 1 Byte für die Reststelle
entspricht also genau dem, was marmot sagte

aber auch in diesem Text, die mal von mir gelernte Trennung von Ganz- und Dezimalzahl vor bzw nach dem Komma

trotzdem verstehe ich nicht, warum es mit der gleichen PHP- und MySQL, und WB- und BakeryVersion (alles auf der gleichen WB-Portable) bei einem der berechtigte Fehler kommt und beim anderem ein Wert von 99999.99 eingetragen wird
« Last Edit: December 13, 2013, 04:06:37 PM by jacobi22 »

Offline dbs

  • Betatester
  • **
  • Posts: 6893
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #19 on: December 13, 2013, 03:55:29 PM »
There is no comma or point in 9999999

jacobi22

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #20 on: December 13, 2013, 03:58:41 PM »
Quote
There is no comma or point in 9999999
not in the installer, but then in the database after the install :wink:

Offline dbs

  • Betatester
  • **
  • Posts: 6893
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #21 on: December 13, 2013, 04:15:17 PM »
funny, in my DB is 999.00 (not 999.99)   :-D

I don't understand the technical crap like "google" or "decimal digits".
The result of our investigations is what?
Remove 2 digits from the installer?

jacobi22

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #22 on: December 13, 2013, 04:29:16 PM »
Quote
The result of our investigations is what?
Remove 2 digits from the installer?

best solution ( i think)
 set the default in the installer to 99999.99  // actual value is 9999999 - no with a decimal point
the exact line 173 in the bakery- install.php
Code:
Only registered users can see contents. Please click here to Register or Login.
p.s. i test other solutions with a DEFAULT = 0 in the Installer and a Update later in the script, but it gives problems, if somebody need the value 0 in this setting (for free shipping every time)

« Last Edit: December 13, 2013, 04:32:23 PM by jacobi22 »

Offline dbs

  • Betatester
  • **
  • Posts: 6893
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #23 on: December 13, 2013, 04:57:58 PM »
Don't understand.
0 or 0.00 is a value, right? How can this make trouble?

jacobi22

  • Guest
Re: Fatal error: Call to a member function numRows() on a non-object in
« Reply #24 on: December 13, 2013, 05:58:10 PM »
the code say's: the value (for freeshipping) can have only and maximal 7 digits in the sum of the left and the right part from the dezimal point, the script say's also: the value has 2 digits on the right side

the DEFAULT in the install.php-script says:  use 9999999 AND 2 Digits after the point, in the sum 9 digits
for a correct mysql-code the default value is too long or is missing a decimal point (see marmot's posting)

if you have a error in the CREATE code, the script will not install this table - thats the problem

(Nachtrag): if you set a smaller value in the installer, which is in the sum of the total digits smaller then 7 and if you have no decimal point in your default value (only 999), the CREATE function use 0 for the digits after the decimal point, thats way you have 999.00 in your database entry if you use 999 as DEFAULT value

remember: this value for free shipping is a price , so you need the 2 digits after the decimal point

if you change the standard value later in your setting, the bakery script will change a simple 0 to a correct value with 2 digits after the decimal point (the price format)
the author will set a high standard value for the free shipping. if you work with zero as standard and nobody change this in the setting, every thing goes out with free shipping  :roll:
« Last Edit: December 13, 2013, 06:24:58 PM by jacobi22 »

 

postern-length