hello, I have this query for creating one code at a time INSERT INTO `database1`.`table1` ( `couponCode`, `pageCount` ) VALUES ( 'promo-001002', '2' ); but this will create only one code. I need a query that will create 200 codes with starting number "-001002". Is there a way to do it? Thanks
you will need to use some coding in php language or whatever example: for($i=1002;$i<1202;$i++) { mysql_query("INSERT INTO `database1`.`table1` ( `couponCode`,`pageCount`) VALUES ('promo-00" . $i . "', '2');"); } PHP:
you codes are easy to guess. At least make sure you don't allow multiple coupons on the same transaction or you'll end up like others selling stuff for 0$