troubleshooting Question

Php mysql random data generator

Avatar of nokiamobile
nokiamobile asked on
PHP
4 Comments1 Solution370 ViewsLast Modified:
Hi,
I need a php script that generate 1.000.000 lines in my mysql table with structure attached in code.

The PrimaryImei should be always 15 numbers.
The other fileds should have randoming lenght and could have characters and numbers.

Thanks


CREATE TABLE table (
  ASCnumber varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  StatoLavorazione varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  Modello varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  CustomerType varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  CustomerLastName varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  CustomerFirstName varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  CustomerPhoneNumber varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  WorkOrderId varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  ServiceCode varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  PrimaryImei varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  AdditionalSerialNumber varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  ProductCode varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  SwVersion varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  NewSwVersion varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  PopDate varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  WarrantyStatus varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  Vid varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  SpecialWarrantyId varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  ReceivingDate varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  ShippingDate varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  SwapDate varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  SwapReasonCode varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  SwapImei varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  RepSymCode1 varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  FaultCode1 varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  KeyRepair1 varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  PartNumber1 varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  CctRef1 varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  RepairModule1 varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  PartReplaced1 varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  ID int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (ID)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros