Jump to content

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...

???

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

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.