Jump to content
Sign in to follow this  
yourwayit

field being inserted as 0 instead of NULL

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×