Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,625
    Plugin Contributions
    123

    Default More casts needed for STRICT databases?

    Starting to see logs like this:

    --> PHP Fatal error: 1366:Incorrect decimal value: '' for column `dbname`.`paypal`.`mc_fee` at row 1 : ...

    where mc_fee is ''. Casting this value to float would fix - wondering if this needs to be done for other decimal fields in this table.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: More casts needed for STRICT databases?

    Rather that overall casting (which can introduce other issues), how about (a) determining why mc_fee was empty and (b) if that's a valid value, setting the value to 0 if it's empty().

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,625
    Plugin Contributions
    123

    Default Re: More casts needed for STRICT databases?

    Interestingly, both techniques are used in this file includes/modules/payment/paypal/paypal_functions.php

    But a cast of an array element before an insert is pretty unlikely to cause problems (unlike a random cast in the middle of a block of logic).
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. More CSS help needed for template 12541
    By neighbornick in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 28 Jun 2009, 01:21 AM
  2. Mysql 5 strict mode no null value for manufacturer id
    By jiffy in forum General Questions
    Replies: 5
    Last Post: 2 Feb 2008, 12:06 AM
  3. More info needed
    By TCC_Inc in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 5 Mar 2007, 10:44 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