Ok, so DATETIME would be the best one to you!?!?
If so ill elaborate on the other question!
Heres my table format as it is now, before i try using DATETIME and that piece of code to change the month!
`m_id` int(9) NOT NULL auto_increment,
`m_name` varchar(100) NOT NULL default '',
`m_age` char(3) NOT NULL default '',
`m_dob_d` char(2) NOT NULL default '',
`m_dob_m` char(2) NOT NULL default '',
`m_dob_y` varchar(4) NOT NULL default '',
`m_county` varchar(50) NOT NULL default '',
`m_country` varchar(100) NOT NULL default '',
`m_gender` varchar(20) NOT NULL default '',
`m_email` varchar(100) NOT NULL default '',
`m_mail` varchar(100) default 'N',
`m_ip` varchar(100) NOT NULL default '',
`m_username` varchar(100) NOT NULL default '',
`m_password` varchar(100) default '0',
`m_usertype` varchar(100) NOT NULL default '1',
`m_upgrade_end` date default NULL,
`m_joined` date NOT NULL default '0000-00-00',
PRIMARY KEY (`m_id`)
A user wants to upgrade their membership. They go through the payment gateway which brings them back to a page on my server that i will use to change m_usertype to 2 with 1 being the standard membership.
But i need the m_upgrade_end to change to to date that the upgrade expires on. So if the user upgrades on the 1st Dec 2005, the date will change to 1st Jan 2006.
BUT!!
If they upgrade for a period of say 3 months. The value of this would come from the product_quantity which is passed back to my srcipt from the payment gateway. Each number in the quantity = 1 or more months of upgrade! Is that clear?? Getting myself all confused!
So would need the UPDATE SQL to change to date, adding x number of months which are defined by the passback variable product_quantity.
Hope this is clear? And you approve of the table. Might be a bit messy im sure!
This is the code that update the info. Its made by an Interakt product, so looks a little strange to me!
// make an instance of the transaction object
$tNG1 = new KT_tNG();
// register to a connection
$tNG1->setConnection($main, $database_main);
//set the STARTER condition
$tNG1->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,(isset($_POST['u_id']) ? $_POST['u_id'] : null));
$tNG1->registerTrigger(ERROR,"KT_TriggerERROR_ProduceFakeRs",1);
// set the autogeneration information
$tNG1->setTransactionType(UPDATE_TYPE);
$tNG1->setTable('ipals_members');
$tNG1->setColumnsName(Array(('m_id'),('m_usertype'),('m_upgrade_end')));
$tNG1->setColumnsType(Array((NUMERIC_TYPE),(STRING_TYPE),(NUMERIC_TYPE)));
$tNG1->setColumnsValue(Array(((isset($_POST['u_id']) ? $_POST['u_id'] : null)),(2),(0000-00-00)));
$tNG1->setUniqueKey('m_id',(isset($_POST['u_id']) ? $_POST['u_id'] : null),NUMERIC_TYPE);
// execute the transaction
$tNG1->executeTransaction();
Thanks,
Danny