Need help with PHP code to populate a database table
Posted: Fri Sep 21, 2007 10:06 am
feyd | Please use
Its a table that stores unique coupon codes to be used for Joomla's Virtuemart online store. I need to add something like 4000 permanent coupons and dont want to do this manually.
Can someone provide me with a sample script I can use in PHP that will insert new coupons with the coupon code starting at 0001 up to 4000?
any help would be appreciated.
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi. I have a mysql table that looks like this:
[syntax="sql"]
CREATE TABLE `jos_vm_coupons` (
`coupon_id` int(16) NOT NULL auto_increment,
`coupon_code` varchar(32) NOT NULL default '',
`percent_or_total` enum('percent','total') NOT NULL default 'percent',
`coupon_type` enum('gift','permanent') NOT NULL default 'gift',
`coupon_value` decimal(12,2) NOT NULL default '0.00',
PRIMARY KEY (`coupon_id`)
) Can someone provide me with a sample script I can use in PHP that will insert new coupons with the coupon code starting at 0001 up to 4000?
any help would be appreciated.
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]