Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

field being inserted as 0 instead of NULL


Guest

Recommended Posts

This isn't really for a contribution but I think this may be the most relevant forum .

 

categories.php:

$sql_data_array = array('products_quantity' => tep_db_prepare_input($_POST['products_quantity']),

                                'products_model' => tep_db_prepare_input($_POST['products_model']),
                                 'products_image' => $products_image,
                                  'products_price_network' => tep_db_prepare_input($products_price_network),
                                  'products_date_available' => $products_date_available,
                                 'products_weight' => tep_db_prepare_input($_POST['products_weight']),
                                 'products_status' => tep_db_prepare_input($_POST['products_status']),
                                 'products_status_network' => tep_db_prepare_input($_POST['products_status_network']),
                                 'products_tax_class_id' => tep_db_prepare_input($_POST['products_tax_class_id']),
                                 'manufacturers_id' => tep_db_prepare_input($_POST['manufacturers_id']),
                                 'per_item_shipping'=> tep_db_prepare_input($_POST['products_per_item_shipping'])
}
                           tep_db_perform(TABLE_PRODUCTS, $sql_data_array);

The concern is 'per_item_shipping' => null . For some reason even explicity setting this to null gets it inserted into the db as 0 (field is a double, set to NULL for default). This makes me assume that somewhere NULL is being converted into a string but I'm not sure where this is happening.

 

If anyone could shed some light on what might be occuring that would be much appreciated.

Cheers,

 

- Marc

Link to comment
Share on other sites

  • 5 months later...

Hi,

I have a similar problem where NULL is not being written to the database but a double 0.000 instead.

Does somebody know what to do to assign NULL to a field with tep_db_perform?

 

Example :

$echeances_value1 = NULL;
...
$sql_data_array = array(...
								'echeances_value1' => $echeances_value1,
								...

 

I also tried,

$echeances_value1 = '';

and

$echeances_value1 = "";

and even

$sql_data_array = array(...
								'echeances_value1' => NULL,

but the database alsways gets 0.000

 

Perhaps one must modify tep_db_perform :-( ?

-i.

*** Je suis plus souvent sur le forum français ***

ms2fr, Header Tags 2.5.5b, Order logging before payment, Better PayPal Description perso, Free shipping per product, Must agree to terms, Country State Selector, World Zones, Visible countries, Store Pick Up, several shipping modules, Personal Invoice Number, 'On the Fly' Auto Thumbnailer using GD Library, More_Pics_6 for 2.2 ms2, Ultimate SEO URLs 2-2.1d/e,Virement Bancaire, Estimated Shipping 1.5, xml_guide, SP+,Step By Step 1.8, Order Editor 2.6.3, Google Analytics, Dynamic Sitemap 2.0, OSC-Expeditor, Recover Cart Sales, Links Manager 1.15

local : linux 2.6 Fedora Core 3, server : APACHE 2.0.54, MySQL 4.1.18, php : 4.4.0 (on strike refuse to update)

remote : IcoOpenBSD 4.x, server : IcodiaSecureHttpd, MySQL 4.1.24, php : 4.4.9

 

You never get a second chance to make a first impression.

Link to comment
Share on other sites

Perhaps one must modify tep_db_perform :-( ?

Yes. Solved for me. MindVerveMedia's solution works great.

-i

*** Je suis plus souvent sur le forum français ***

ms2fr, Header Tags 2.5.5b, Order logging before payment, Better PayPal Description perso, Free shipping per product, Must agree to terms, Country State Selector, World Zones, Visible countries, Store Pick Up, several shipping modules, Personal Invoice Number, 'On the Fly' Auto Thumbnailer using GD Library, More_Pics_6 for 2.2 ms2, Ultimate SEO URLs 2-2.1d/e,Virement Bancaire, Estimated Shipping 1.5, xml_guide, SP+,Step By Step 1.8, Order Editor 2.6.3, Google Analytics, Dynamic Sitemap 2.0, OSC-Expeditor, Recover Cart Sales, Links Manager 1.15

local : linux 2.6 Fedora Core 3, server : APACHE 2.0.54, MySQL 4.1.18, php : 4.4.0 (on strike refuse to update)

remote : IcoOpenBSD 4.x, server : IcodiaSecureHttpd, MySQL 4.1.24, php : 4.4.9

 

You never get a second chance to make a first impression.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...