Jump to content

[SOLVED] Posted value is being changed...wierd


techtheatre

Recommended Posts

My PHP code is submitting the following query (i have even done it manually in phpMyAdmin):

 

INSERT INTO ValuesTemp ( CdId , InvId , CustomerId , CardPart , Month , Year, CreationDate ) VALUES (NULL , '3' , '' , '12345678901' , '07' , '2007', now() );

 

The table structure is:

CREATE TABLE `ValuesTemp` (
  `CdId` int(10) NOT NULL auto_increment,
  `InvId` int(10) NOT NULL default '0',
  `CustomerId` int(10) NOT NULL default '0',
  `CardPart` int(20) NOT NULL default '0',
  `Month` int(2) NOT NULL default '0',
  `Year` int(4) NOT NULL default '0',
  `CreationDate` date NOT NULL default '0000-00-00',
  `CompletionDate` date NOT NULL default '0000-00-00',
  PRIMARY KEY  (`CdId`)
) TYPE=MyISAM AUTO_INCREMENT=4 ;

 

 

All the values seem to be storing correctly except that for some reason the value for "CardPart" keeps showing up in the database as 2147483647

What am i doing wrong? :-\ This is very strange (i think).  Thanks!

Have you tried passing it to the query as a variable?

 

$test = '12345678901';

 

INSERT INTO ValuesTemp ( CdId , InvId , CustomerId , CardPart , Month , Year, CreationDate ) VALUES (NULL , '3' , '' , '$test' , '07' , '2007', now() );

 

 

Does it show up as that number no matter what value you try to Insert CardPart is?

yes...i have passed it several ways and also had the sql string echoed to the screen so i could read it myself...each time the input number (12345678901) becomes 2147483647 once it is in the DB table.  I have even used phpMyAdmin to insert the correct query, and even then it says that it was "successful" but when i look at it the numbers are wrong...

???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.