Google Ads

Creating an Iterator for While Loop Forms in PHP/MySQL PHP Script


Creating an Iterator for While Loop Forms in PHP/MySQL PHP Script

This tutorial will teach you on how to create iterator to use in while loops form to identify that a certain element of a form is associated with another element. In the case of this tutorial, we use iterator to associate our text with the selected product’s id.

Creating our Database

First step is to create our database.
1. Open phpMyAdmin.
2. Click databases, create a database and name it as test.
3. After creating a database, click the SQL and paste the below codes. See image below for detailed instruction.

 

  1. CREATE TABLE `details` (
  2. `detailsid` INT(11) NOT NULL AUTO_INCREMENT,
  3. `purchaseid` INT(11) NOT NULL,
  4. `productid` INT(11) NOT NULL,
  5. `quantity` DOUBLE NOT NULL,
  6. PRIMARY KEY(`detailsid`)
  7. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  8. CREATE TABLE `product` (
  9. `productid` INT(11) NOT NULL AUTO_INCREMENT,
  10. `product_name` VARCHAR(50) NOT NULL,
  11. `price` DOUBLE NOT NULL,
  12. PRIMARY KEY(`productid`)
  13. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  14. CREATE TABLE `purchase` (
  15. `purchaseid` INT(11) NOT NULL AUTO_INCREMENT,
  16. `name` VARCHAR(50) NOT NULL,
  17. `total` DOUBLE NOT NULL,
  18. `date` datetime NOT NULL,
  19. PRIMARY KEY(`purchaseid`)
  20. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  21. INSERT INTO `product` (`productid`, `product_name`, `price`) VALUES
  22. (4, ‘Laptop’, 699.99),
  23. (5, ‘Desktop Pc’, 999.99),
  24. (6, ‘Tablet’, 299.99);

 

 

 

 


Related Post

MarketPlace – Apps, Websites and Domains Sel... MarketPlace - Apps, Websites and Domains Selling ScriptMarketPlace - Apps, Websites and Domains Selling Script3-in-1 script to help you make serious m...
Simple Dynamic Web Site PHP Script Simple Dynamic Web Site PHP Script Installation 01. Extract all content into your host. 02. Create New Database Name "maindb" 03. Import Datab...
PHP Radio Stations Database v1.4 PHP Script Downlo... PHP Radio Stations Database v1.4PHP Radio Stations Database v1.4PHP Radio Stations Database is a simple, yet unique script which allows users to disco...
Tiger Post PHP Script Download Tiger Post v3.0.2 - Facebook Auto Post Multi Pages/Groups/ProfilesTiger Post v3.0.2 - Facebook Auto Post Multi Pages/Groups/ProfilesTiger Post – Fac...
iYootoob – Youtube API Automation PHP Script Downl... This system used youtube api v3 to build a standalone webistes based in your country or region code. Visitors can search millions of videos from youtu...

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *