Author Topic: mysql bug - either php 5 or mysql 5 problem  (Read 5908 times)

Offline feeble

mysql bug - either php 5 or mysql 5 problem
« on: March 08, 2007, 03:21:47 pm »
been getting
Code: [Select]
Database Error: Field 'trading' doesn't have a default value
File: D:\htdocs\Sources\shop\Shop-Buy.php
Line: 206

to fix your install daniel can you consider changing:
Code: [Select]
db_query("
CREATE TABLE IF NOT EXISTS {$db_prefix}shop_inventory (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
`ownerid` INT UNSIGNED NOT NULL ,
`itemid` INT UNSIGNED NOT NULL ,
`amtpaid` DECIMAL(8, 2) UNSIGNED DEFAULT '0.00' NOT NULL,
`trading` TINYINT(1) UNSIGNED NOT NULL,
`tradecost` DECIMAL(8, 2) NOT NULL,
PRIMARY KEY (`id`)
)", __FILE__, __LINE__);
to
Code: [Select]
db_query("
CREATE TABLE IF NOT EXISTS {$db_prefix}shop_inventory (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
`ownerid` INT UNSIGNED NOT NULL ,
`itemid` INT UNSIGNED NOT NULL ,
`amtpaid` DECIMAL(8, 2) UNSIGNED DEFAULT '0.00' NOT NULL,
`trading` TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL,
`tradecost` DECIMAL(8, 2) DEFAULT '0.00' NOT NULL,
PRIMARY KEY (`id`)
)", __FILE__, __LINE__);

Offline Daniel15

Re: mysql bug - either php 5 or mysql 5 problem
« Reply #1 on: March 08, 2007, 03:54:16 pm »
Grrr... Looks like a MySQL Strict Mode problem. Strict mode is a new MySQL mode introduced with MySQL 5. Basically, it's very strict about all the little things that it never used to care about :P

I'll try fix this as soon as possible

Offline feeble

Re: mysql bug - either php 5 or mysql 5 problem
« Reply #2 on: March 08, 2007, 05:52:56 pm »
Grrr... Looks like a MySQL Strict Mode problem. Strict mode is a new MySQL mode introduced with MySQL 5. Basically, it's very strict about all the little things that it never used to care about :P

I'll try fix this as soon as possible

bah

clean up your code ;)

mysql 5 is the future.

Offline Daniel15

Re: mysql bug - either php 5 or mysql 5 problem
« Reply #3 on: March 09, 2007, 09:51:11 am »
Quote
clean up your code
It's not my fault, most of the table creation queries were taken directly from either phpMyAdmin or mysqldump (both running under MySQL 4) ;)

I do a lot of development work on a server running PHP 5.2.1 and MySQL 5.0.32, and haven't experienced any problems - I guess strict mode is turned off in my config.

Offline palatable

Re: mysql bug - either php 5 or mysql 5 problem
« Reply #4 on: June 07, 2017, 10:59:45 pm »
I have this problem. It's great advice for me. Thank you.