title
4. E - Commerce Website Tutorial - PHP MySQL Inventory Management

description
In this 4th video we will create the Inventory management page in the Admin area. List all inventory and make a form and parser for adding new inventory items. The E - Commerce Web Site we will be assembling is one in which all of the inventory is in a MySQL database and we offer a custom PHP cart for a unique shopping experience. It is a site that handles sales, customers, and inventory.

detail
{'title': '4. E - Commerce Website Tutorial - PHP MySQL Inventory Management', 'heatmap': [{'end': 680.042, 'start': 660.824, 'weight': 0.709}, {'end': 744.669, 'start': 708.444, 'weight': 0.831}], 'summary': 'This e-commerce website tutorial focuses on inventory management, covering php implementation, inventory list creation, javascript form validation, product uploading, file upload mechanism, and parsing. it emphasizes the importance of keeping things basic to understand the backbones of the system and allowing for creativity and expansion.', 'chapters': [{'end': 146.032, 'segs': [{'end': 84.184, 'src': 'embed', 'start': 27.255, 'weight': 0, 'content': [{'end': 34.441, 'text': 'the focus of this series is going to be keep things basic, get people to understand the backbones of systems like this,', 'start': 27.255, 'duration': 7.186}, {'end': 38.965, 'text': 'and then they themselves can get creative, knowledgeable and expand upon it.', 'start': 34.441, 'duration': 4.524}, {'end': 43.703, 'text': "okay now, with that said, let's continue.", 'start': 40, 'duration': 3.703}, {'end': 45.224, 'text': "okay, here's my inventory.", 'start': 43.703, 'duration': 1.521}, {'end': 49.027, 'text': "that's going to serve as dummy data for my store.", 'start': 45.224, 'duration': 3.803}, {'end': 56.853, 'text': "you'll notice that each one of my product images is the same size and aspect ratio.", 'start': 49.027, 'duration': 7.826}, {'end': 65.119, 'text': 'when we last left off, we successfully created the admin area index page and the admin login form.', 'start': 56.853, 'duration': 8.266}, {'end': 72.941, 'text': 'so on the index page, When the admin is logged in successfully, we give them a link to a page called inventorylist.php.', 'start': 65.119, 'duration': 7.822}, {'end': 84.184, 'text': "So let's just take this index page, file, save as inventorylist underscore list dot php.", 'start': 73.981, 'duration': 10.203}], 'summary': 'Focus on basic understanding of systems, creating admin area, and serving dummy data for store with uniform product images.', 'duration': 56.929, 'max_score': 27.255, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI27255.jpg'}, {'end': 146.032, 'src': 'embed', 'start': 126.385, 'weight': 2, 'content': [{'end': 140.61, 'text': 'but you can choose to externalize this code by creating a, either a PHP class file or B creating a PHP include file where this code would be included.', 'start': 126.385, 'duration': 14.225}, {'end': 144.191, 'text': "like I said, I'm leaving it on the page because it's just fine.", 'start': 140.61, 'duration': 3.581}, {'end': 146.032, 'text': "let's get this down so you can see the code more.", 'start': 144.191, 'duration': 1.841}], 'summary': 'Code can be externalized by creating a php class file or include file.', 'duration': 19.647, 'max_score': 126.385, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI126385.jpg'}], 'start': 10.762, 'title': 'E-commerce part 4: inventory management', 'summary': 'Covers inventory management in an e-commerce website building lesson series, emphasizing the importance of keeping things basic to understand the backbones of the system and allowing for creativity and expansion. it includes creating an inventory list page, manipulating code for the admin area index page, and the importance of externalizing code for reuse.', 'chapters': [{'end': 146.032, 'start': 10.762, 'title': 'E-commerce part 4: inventory management', 'summary': 'Covers inventory management in an e-commerce website building lesson series, emphasizing the importance of keeping things basic to understand the backbones of the system and allowing for creativity and expansion. it includes creating an inventory list page, manipulating code for the admin area index page, and the importance of externalizing code for reuse.', 'duration': 135.27, 'highlights': ['The chapter emphasizes the goal of keeping things basic to help people understand the backbones of the system, allowing for creativity and expansion (quantifiable: emphasis on simplicity and foundational understanding)', 'The process involves creating an inventory list page and manipulating code for the admin area index page (quantifiable: specific tasks in the lesson)', 'The importance of externalizing code for reuse is highlighted, with the option to create a PHP class file or a PHP include file for this purpose (quantifiable: emphasis on code reusability)']}], 'duration': 135.27, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI10762.jpg', 'highlights': ['The chapter emphasizes the goal of keeping things basic to help people understand the backbones of the system, allowing for creativity and expansion', 'The process involves creating an inventory list page and manipulating code for the admin area index page', 'The importance of externalizing code for reuse is highlighted, with the option to create a PHP class file or a PHP include file for this purpose']}, {'end': 395.511, 'segs': [{'end': 295.039, 'src': 'embed', 'start': 214.938, 'weight': 0, 'content': [{'end': 218.099, 'text': "So it's going to select all fields from the products table.", 'start': 214.938, 'duration': 3.161}, {'end': 219.56, 'text': 'Now we simply count.', 'start': 218.499, 'duration': 1.061}, {'end': 224.718, 'text': 'that SQL query output result set.', 'start': 220.555, 'duration': 4.163}, {'end': 227.661, 'text': 'so the result set of how many items it gathers.', 'start': 224.718, 'duration': 2.943}, {'end': 229.242, 'text': "we'll put into a little variable.", 'start': 227.661, 'duration': 1.581}, {'end': 230.563, 'text': "that's a number.", 'start': 229.242, 'duration': 1.321}, {'end': 232.445, 'text': "it'll be product count.", 'start': 230.563, 'duration': 1.882}, {'end': 242.453, 'text': 'now, after we gather the count, we say if product count is greater than zero, that means there are results and there are products in the database.', 'start': 232.445, 'duration': 10.008}, {'end': 244.394, 'text': "we're going to output them.", 'start': 242.453, 'duration': 1.941}, {'end': 252.812, 'text': "else we're gonna output a message within the product list variable that will make the product list output.", 'start': 244.394, 'duration': 8.418}, {'end': 256.353, 'text': 'say you have no products listed in your store yet.', 'start': 252.812, 'duration': 3.541}, {'end': 263.579, 'text': "so here in the if, the if part of this statement we're saying if the product count is greater than zero,", 'start': 256.353, 'duration': 7.226}, {'end': 267.182, 'text': 'then we definitely want to output a product list from the database.', 'start': 263.579, 'duration': 3.603}, {'end': 270.304, 'text': "so let's put in the while loop.", 'start': 267.182, 'duration': 3.122}, {'end': 277.349, 'text': 'now. with the while loop in there we can access all of the rows that come out and each field in each row that we want to access,', 'start': 270.304, 'duration': 7.045}, {'end': 283.751, 'text': "And we're going to compound that into a product list variable which will make each one a line.", 'start': 278.447, 'duration': 5.304}, {'end': 286.833, 'text': "You can see in each one's output, I have a line break.", 'start': 284.411, 'duration': 2.422}, {'end': 292.077, 'text': "And all I'm outputting right now is the ID variable coming out of each row.", 'start': 287.493, 'duration': 4.584}, {'end': 295.039, 'text': "You see I'm accessing each row's ID.", 'start': 292.777, 'duration': 2.262}], 'summary': "Sql query outputs product count and list if >0, else outputs 'no products listed'.", 'duration': 80.101, 'max_score': 214.938, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI214938.jpg'}, {'end': 395.511, 'src': 'embed', 'start': 369.018, 'weight': 1, 'content': [{'end': 374.062, 'text': "You're echoing out the product list, however many products there are in the inventory.", 'start': 369.018, 'duration': 5.044}, {'end': 377.444, 'text': 'And each one will have a line break.', 'start': 375.523, 'duration': 1.921}, {'end': 388.091, 'text': "Now if you don't know about loops, loops will iterate over an array of data to make each one output if you need to within the loop.", 'start': 377.804, 'duration': 10.287}, {'end': 393.29, 'text': 'And since when you query a MySQL database, you get an array.', 'start': 389.508, 'duration': 3.782}, {'end': 395.511, 'text': 'We use MySQL fetch array.', 'start': 393.83, 'duration': 1.681}], 'summary': 'Echo product list from inventory using mysql fetch array and loops.', 'duration': 26.493, 'max_score': 369.018, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI369018.jpg'}], 'start': 147.608, 'title': 'Php inventory list implementation', 'summary': "Focuses on querying the database to retrieve product information, initializing the product count, and using a while loop to access and output each product's id. it also demonstrates implementing an inventory list using php to echo out the product list from a mysql database and iterate over an array of data to output each product with a line break.", 'chapters': [{'end': 337.022, 'start': 147.608, 'title': 'Php inventory list with mysql', 'summary': "Focuses on querying the database to retrieve product information and outputting the product list, initializing the product count and using a while loop to access and output each product's id.", 'duration': 189.414, 'highlights': ['Querying the database to select all fields from the products table The SQL query selects all fields from the products table to retrieve product information.', 'Initializing the product count and outputting a message if no products are listed The product count is initialized and used to determine if there are products in the database, and if not, a message is outputted.', "Using a while loop to access all the rows and output each product's ID A while loop is utilized to access and output each product's ID from the database, with the potential for further information retrieval for each product."]}, {'end': 395.511, 'start': 337.022, 'title': 'Php inventory list implementation', 'summary': 'Demonstrates implementing an inventory list using php to echo out the product list from a mysql database and iterate over an array of data to output each product with a line break.', 'duration': 58.489, 'highlights': ['Implementing an inventory list using PHP to echo out the product list from a MySQL database', 'Iterating over an array of data to output each product with a line break', 'Using MySQL fetch array to query a MySQL database and get an array']}], 'duration': 247.903, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI147608.jpg', 'highlights': ['Querying the database to select all fields from the products table The SQL query selects all fields from the products table to retrieve product information.', 'Implementing an inventory list using PHP to echo out the product list from a MySQL database', "Using a while loop to access all the rows and output each product's ID A while loop is utilized to access and output each product's ID from the database, with the potential for further information retrieval for each product.", 'Iterating over an array of data to output each product with a line break', 'Using MySQL fetch array to query a MySQL database and get an array', 'Initializing the product count and outputting a message if no products are listed The product count is initialized and used to determine if there are products in the database, and if not, a message is outputted.']}, {'end': 757.03, 'segs': [{'end': 456.3, 'src': 'embed', 'start': 397.312, 'weight': 4, 'content': [{'end': 400.453, 'text': 'So in design view, we have something that says inventory list.', 'start': 397.312, 'duration': 3.141}, {'end': 403.695, 'text': "And then you'll have your list output right here.", 'start': 401.274, 'duration': 2.421}, {'end': 409.958, 'text': "But on this page also, since I'm just showing the basics, I'm going to make this whole system very, very basic.", 'start': 404.475, 'duration': 5.483}, {'end': 415.961, 'text': "And maybe above this div right here, I'm going to have another div that's aligned to the right over here.", 'start': 410.578, 'duration': 5.383}, {'end': 419.454, 'text': 'And I want it to say big plus sign.', 'start': 416.733, 'duration': 2.721}, {'end': 422.554, 'text': 'And have it say add new store item.', 'start': 419.894, 'duration': 2.66}, {'end': 425.255, 'text': "Alright, so let's highlight that div.", 'start': 423.795, 'duration': 1.46}, {'end': 427.356, 'text': 'Since we want one right on top of it.', 'start': 425.835, 'duration': 1.521}, {'end': 428.616, 'text': 'Highlight it.', 'start': 428.196, 'duration': 0.42}, {'end': 429.516, 'text': 'Go into code view.', 'start': 428.676, 'duration': 0.84}, {'end': 432.117, 'text': 'You can see the div is highlighted for us.', 'start': 430.396, 'duration': 1.721}, {'end': 433.577, 'text': "Let's go right above it.", 'start': 432.717, 'duration': 0.86}, {'end': 435.358, 'text': 'Put in a new div.', 'start': 434.497, 'duration': 0.861}, {'end': 441.739, 'text': 'Okay Remove that.', 'start': 437.938, 'duration': 3.801}, {'end': 444.26, 'text': 'Div Align.', 'start': 443.079, 'duration': 1.181}, {'end': 456.3, 'text': 'Right, give it a style and go to margin right, 24 pixels or even a little more, 32 pixels.', 'start': 445.46, 'duration': 10.84}], 'summary': "Designing basic inventory list with 'add new store item' div aligned to the right.", 'duration': 58.988, 'max_score': 397.312, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI397312.jpg'}, {'end': 525.76, 'src': 'embed', 'start': 493.726, 'weight': 1, 'content': [{'end': 496.748, 'text': "It's just going to be an anchored link to this same page.", 'start': 493.726, 'duration': 3.022}, {'end': 499.329, 'text': "Under this div, we're going to put a form.", 'start': 497.308, 'duration': 2.021}, {'end': 501.851, 'text': 'The form is going to be for adding new items.', 'start': 500.03, 'duration': 1.821}, {'end': 510.705, 'text': "So anytime, even if this list is very long, this inventory list, maybe there's, it gets up to be 20, 50 items in there.", 'start': 503.413, 'duration': 7.292}, {'end': 518.577, 'text': "At any time they can click this and it'll shoot them down to the form on the page to be able to put a new item in.", 'start': 511.466, 'duration': 7.111}, {'end': 525.76, 'text': 'But if you want to make yours a little different, you can make this a link to another page, which is all.', 'start': 519.417, 'duration': 6.343}], 'summary': 'An anchored link allows quick access to add new items to the inventory list, even if it has 20-50 items.', 'duration': 32.034, 'max_score': 493.726, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI493726.jpg'}, {'end': 680.042, 'src': 'heatmap', 'start': 610.828, 'weight': 3, 'content': [{'end': 618.051, 'text': "See it? So that'll make the page snap into view for this targeted region when the user clicks that link.", 'start': 610.828, 'duration': 7.223}, {'end': 622.394, 'text': "I'm going to wrap an HTML form around this table.", 'start': 619.053, 'duration': 3.341}, {'end': 623.574, 'text': "I'm going to go into code view.", 'start': 622.414, 'duration': 1.16}, {'end': 626.654, 'text': "Right here, I'm going to pop in a form tag.", 'start': 624.854, 'duration': 1.8}, {'end': 632.776, 'text': 'Action is going to be the same file.', 'start': 629.855, 'duration': 2.921}, {'end': 645.438, 'text': 'InventoryList.php ENC type, multi-part form data.', 'start': 633.996, 'duration': 11.442}, {'end': 649.842, 'text': 'Name could be my form.', 'start': 647.782, 'duration': 2.06}, {'end': 654.263, 'text': 'ID is also my form.', 'start': 652.623, 'duration': 1.64}, {'end': 661.765, 'text': 'Methods, post.', 'start': 660.824, 'duration': 0.941}, {'end': 664.545, 'text': 'That should be all we need for now.', 'start': 663.525, 'duration': 1.02}, {'end': 667.706, 'text': "Now let's go under the table, the very bottom.", 'start': 665.325, 'duration': 2.381}, {'end': 672.046, 'text': 'Line break, the opening bracket, then forward slash.', 'start': 668.666, 'duration': 3.38}, {'end': 675.127, 'text': "And it'll automatically close that tag for you.", 'start': 672.807, 'duration': 2.32}, {'end': 680.042, 'text': "Any tag that's open that should be closed, it will close that tag for you.", 'start': 675.939, 'duration': 4.103}], 'summary': 'Adding an html form with specific attributes and closing tags for a table', 'duration': 50.937, 'max_score': 610.828, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI610828.jpg'}, {'end': 768.06, 'src': 'heatmap', 'start': 708.444, 'weight': 0, 'content': [{'end': 714.766, 'text': 'Okay, so you can see, I have my add new inventory form all set up and it has one, two, three, four, five,', 'start': 708.444, 'duration': 6.322}, {'end': 717.707, 'text': 'six fields of information that are going to be sent through.', 'start': 714.766, 'duration': 2.941}, {'end': 723.529, 'text': "Let's go into the code view, and you can see within that table are all the fields.", 'start': 717.727, 'duration': 5.802}, {'end': 726.37, 'text': 'Each field has a name and ID.', 'start': 724.369, 'duration': 2.001}, {'end': 732.366, 'text': 'So when the person presses submit, all of those values will be posted to the script.', 'start': 727.045, 'duration': 5.321}, {'end': 736.787, 'text': 'And we can access them and parse all those values to the database.', 'start': 732.946, 'duration': 3.841}, {'end': 744.669, 'text': 'And here we have a file field, which this one, we have to upload this file they submit to a folder on the website.', 'start': 737.728, 'duration': 6.941}, {'end': 750.631, 'text': 'The file that they submit, the JPEG image they submit, is not going to go into the database.', 'start': 744.689, 'duration': 5.942}, {'end': 752.391, 'text': "It's going to go into a folder.", 'start': 751.231, 'duration': 1.16}, {'end': 757.03, 'text': "And it's going to get the ID of this product as its title.", 'start': 753.106, 'duration': 3.924}, {'end': 768.06, 'text': "And I'm going to choose to use JavaScript to validate the form to make sure that all the fields are filled in rather than using PHP to validate it.", 'start': 759.052, 'duration': 9.008}], 'summary': 'An inventory form with six fields will be processed to parse values to the database and upload files to a folder using javascript for form validation.', 'duration': 59.616, 'max_score': 708.444, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI708444.jpg'}], 'start': 397.312, 'title': 'Inventory list creation', 'summary': "Covers designing an inventory list with a basic system and incorporating a 'big plus sign' div for adding new items, along with creating an inventory form, a linked anchor tag, and managing file uploads.", 'chapters': [{'end': 456.3, 'start': 397.312, 'title': 'Basic inventory list design', 'summary': "Discusses the design of an inventory list with a basic system and the addition of a 'big plus sign' div aligned to the right for adding new store items.", 'duration': 58.988, 'highlights': ['Designing an inventory list with a basic system The system is kept very basic for the inventory list design.', "Adding a 'big plus sign' div aligned to the right A new div with a 'big plus sign' is aligned to the right for adding new store items."]}, {'end': 757.03, 'start': 456.3, 'title': 'Creating inventory form and link', 'summary': 'Demonstrates creating an inventory form and a linked anchor tag, allowing users to add new items to a list on the same page, as well as the process of constructing the form and managing file uploads.', 'duration': 300.73, 'highlights': ['The form allows users to add new items to the inventory list on the same page, facilitating easy access and input for up to six fields of information.', 'An anchor tag is created to allow users to jump to the form on the page, enhancing user experience and ease of navigation.', 'The process of constructing the form involves wrapping an HTML form around the table, setting up form elements, and specifying the form action, method, and encoding type for data submission.', 'The file upload feature enables users to submit JPEG images, which are stored in a folder on the website with the respective product ID as the file title.']}], 'duration': 359.718, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI397312.jpg', 'highlights': ['The file upload feature enables users to submit JPEG images, which are stored in a folder on the website with the respective product ID as the file title.', 'The form allows users to add new items to the inventory list on the same page, facilitating easy access and input for up to six fields of information.', 'An anchor tag is created to allow users to jump to the form on the page, enhancing user experience and ease of navigation.', 'The process of constructing the form involves wrapping an HTML form around the table, setting up form elements, and specifying the form action, method, and encoding type for data submission.', "Adding a 'big plus sign' div aligned to the right A new div with a 'big plus sign' is aligned to the right for adding new store items.", 'Designing an inventory list with a basic system The system is kept very basic for the inventory list design.']}, {'end': 986.686, 'segs': [{'end': 788.963, 'src': 'embed', 'start': 759.052, 'weight': 0, 'content': [{'end': 768.06, 'text': "And I'm going to choose to use JavaScript to validate the form to make sure that all the fields are filled in rather than using PHP to validate it.", 'start': 759.052, 'duration': 9.008}, {'end': 773.525, 'text': "Because honestly, if somebody's an admin in the store, it's not like having a social network.", 'start': 768.26, 'duration': 5.265}, {'end': 778.31, 'text': "The person, whoever's admin in the store, is there to do business and do it correctly.", 'start': 773.666, 'duration': 4.644}, {'end': 779.84, 'text': "They're not going to be fooling around.", 'start': 778.68, 'duration': 1.16}, {'end': 788.963, 'text': 'But you can still validate it to make sure that they have all the fields filled in before they press submit or before you parse the data to the database.', 'start': 780.04, 'duration': 8.923}], 'summary': 'Javascript used for form validation to ensure all fields are filled before submission.', 'duration': 29.911, 'max_score': 759.052, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI759052.jpg'}, {'end': 836.137, 'src': 'embed', 'start': 807.093, 'weight': 2, 'content': [{'end': 809.295, 'text': 'when it comes to category and subcategory.', 'start': 807.093, 'duration': 2.202}, {'end': 817.181, 'text': 'Okay, So before we placed a little bit of PHP on top of this script here right above,', 'start': 810.436, 'duration': 6.745}, {'end': 825.328, 'text': "where we're selecting all from products to show the product list to the store manager, we're going to get a few more items.", 'start': 817.181, 'duration': 8.147}, {'end': 827.67, 'text': "Let's just get at least the product name out.", 'start': 825.368, 'duration': 2.302}, {'end': 836.137, 'text': 'This would be product name accessing from the database.', 'start': 830.772, 'duration': 5.365}], 'summary': 'Adding php to display product name from database.', 'duration': 29.044, 'max_score': 807.093, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI807093.jpg'}, {'end': 938.243, 'src': 'embed', 'start': 908.456, 'weight': 1, 'content': [{'end': 910.957, 'text': "Which you don't have to have yours all blocked off.", 'start': 908.456, 'duration': 2.501}, {'end': 913.098, 'text': 'It could be one giant PHP block.', 'start': 911.017, 'duration': 2.081}, {'end': 917.379, 'text': "But I'm just, for demonstration purposes, I'm going to keep my blocks separate.", 'start': 914.078, 'duration': 3.301}, {'end': 922.437, 'text': 'So what this block is going to do is error reporting.', 'start': 918.755, 'duration': 3.682}, {'end': 929.019, 'text': "Since your scripting is getting a little more complicated, you might want to know if anything's wrong in your script.", 'start': 923.237, 'duration': 5.782}, {'end': 938.243, 'text': "So if you run these two lines in your script, they'll show errors no matter what you have claimed inside of your PHP any file on your server.", 'start': 929.68, 'duration': 8.563}], 'summary': 'Php block for error reporting to detect script issues.', 'duration': 29.787, 'max_score': 908.456, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI908456.jpg'}], 'start': 759.052, 'title': 'Javascript form validation, product list update, and php error reporting', 'summary': 'Covers javascript form validation for all fields, switching form elements to select tags, adding product name to the product list using php, and implementing error reporting in php scripts for better management and debugging.', 'chapters': [{'end': 805.568, 'start': 759.052, 'title': 'Javascript form validation and select tags', 'summary': "Discusses using javascript for form validation instead of php, stressing the importance of ensuring all fields are filled in and switching form elements to select tags to restrict the store manager's options.", 'duration': 46.516, 'highlights': ['Using JavaScript for form validation to ensure all fields are filled before submission or data parsing.', "Changing form elements to select tags to limit the store manager's options.", 'Emphasizing the importance of store managers doing business correctly and not fooling around.']}, {'end': 907.136, 'start': 807.093, 'title': 'Adding product name to product list', 'summary': 'Discusses adding the product name to the product list displayed to the store manager, by including php code between the existing blocks and accessing the product name from the database.', 'duration': 100.043, 'highlights': ['Adding product name to the product list by including PHP code to access the product name from the database.', 'Inserting PHP block to grab the whole list for viewing in the product output list.', 'Incorporating PHP code between the existing blocks to display additional items in the product output list.']}, {'end': 986.686, 'start': 908.456, 'title': 'Php script error reporting', 'summary': 'Explains the importance of error reporting in php scripts and how to implement it, emphasizing the need to force errors to the page for better script management and debugging.', 'duration': 78.23, 'highlights': ['The PHP script demonstrates the implementation of error reporting to identify issues in the script, promoting better script management and debugging.', 'The speaker suggests using specific lines of code to force errors to the page for better script management, emphasizing the significance of accurate error reporting in complex scripts.', 'The chapter emphasizes the need for error reporting in PHP scripts, especially as they become more complex, to ensure efficient script management and identify any issues.']}], 'duration': 227.634, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI759052.jpg', 'highlights': ['Using JavaScript for form validation to ensure all fields are filled before submission or data parsing.', 'The PHP script demonstrates the implementation of error reporting to identify issues in the script, promoting better script management and debugging.', 'Adding product name to the product list by including PHP code to access the product name from the database.']}, {'end': 1240.507, 'segs': [{'end': 1126.279, 'src': 'embed', 'start': 1022.547, 'weight': 1, 'content': [{'end': 1027.992, 'text': 'so the first thing that happens is we have an if condition which all of this code is wrapped in,', 'start': 1022.547, 'duration': 5.445}, {'end': 1035.548, 'text': 'that if condition And what that if condition states is if is set post product name from the form.', 'start': 1027.992, 'duration': 7.556}, {'end': 1042.432, 'text': "So if the form button is pressed, we're going to parse the form.", 'start': 1037.169, 'duration': 5.263}, {'end': 1050.778, 'text': 'This code will not run unless that form button is pressed to post the product name field to this script.', 'start': 1043.553, 'duration': 7.225}, {'end': 1055.721, 'text': 'So this if condition makes sure that somebody has pressed that submit form.', 'start': 1051.258, 'duration': 4.463}, {'end': 1063.664, 'text': 'These next one, two, three, four, five lines They gather the posted variable from the form.', 'start': 1056.281, 'duration': 7.383}, {'end': 1069.652, 'text': "Inside of that, we're using the MySQL real escape string function to cleanse the data.", 'start': 1064.224, 'duration': 5.428}, {'end': 1073.597, 'text': "It's a way to filter your data.", 'start': 1072.135, 'duration': 1.462}, {'end': 1075.995, 'text': 'before you send it into a database.', 'start': 1074.113, 'duration': 1.882}, {'end': 1082.321, 'text': 'And remember in this first PHP block up here, we are connecting to the database right there.', 'start': 1076.676, 'duration': 5.645}, {'end': 1089.328, 'text': 'So to use that function, MySQL real escape string, you have to be connected to the database.', 'start': 1083.562, 'duration': 5.766}, {'end': 1094.993, 'text': "If you weren't connected to the database and you ran this PHP function, you would notice an error.", 'start': 1090.129, 'duration': 4.864}, {'end': 1100.238, 'text': 'Now, since we are gathering all the posted variables from the form, we cleansed them there.', 'start': 1095.954, 'duration': 4.284}, {'end': 1104.741, 'text': 'we have them all set up nice in local PHP variables here at this point.', 'start': 1100.238, 'duration': 4.503}, {'end': 1111.167, 'text': 'Then we see if that product name is an identical match to another product in the database.', 'start': 1106.283, 'duration': 4.884}, {'end': 1112.548, 'text': 'So we select.', 'start': 1111.867, 'duration': 0.681}, {'end': 1119.456, 'text': 'ID from products where product name equals this product name that the person is trying to upload.', 'start': 1113.513, 'duration': 5.943}, {'end': 1122.377, 'text': 'Limit 1.', 'start': 1120.957, 'duration': 1.42}, {'end': 1126.279, 'text': "Then we can run mysql numros to see if there's a product match in that name.", 'start': 1122.377, 'duration': 3.902}], 'summary': 'The php script checks for form submission and filters and checks for duplicate product names in the database.', 'duration': 103.732, 'max_score': 1022.547, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI1022547.jpg'}, {'end': 1212.087, 'src': 'embed', 'start': 1184.486, 'weight': 0, 'content': [{'end': 1194.216, 'text': 'So you SQL query into, insert into products, product name, price, details, category, subcategory, and the date added.', 'start': 1184.486, 'duration': 9.73}, {'end': 1199.482, 'text': "Those are the fields that we're going to fill with the values of.", 'start': 1194.737, 'duration': 4.745}, {'end': 1202.6, 'text': 'product name variable price.', 'start': 1200.478, 'duration': 2.122}, {'end': 1205.482, 'text': 'variable gathered from the form.', 'start': 1202.6, 'duration': 2.882}, {'end': 1212.087, 'text': 'details. variable gathered from the form, category and subcategory that the person typed in and now.', 'start': 1205.482, 'duration': 6.605}], 'summary': 'Using sql query to insert product details into database fields like name, price, details, category, subcategory, and date added.', 'duration': 27.601, 'max_score': 1184.486, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI1184486.jpg'}], 'start': 986.686, 'title': 'Php form data parsing and product uploading script', 'summary': 'Covers parsing form data in php, filtering with mysql real escape string, and ensuring database connection for data cleansing and upload. it also explains a php script for uploading products, checking for duplicate product names, and inserting new products into a database using sql queries and conditional statements.', 'chapters': [{'end': 1100.238, 'start': 986.686, 'title': 'Php form data parsing', 'summary': 'Covers parsing form data in php, including filtering with mysql real escape string, and ensuring database connection for data cleansing and upload, emphasizing the necessity of the form button press for code execution.', 'duration': 113.552, 'highlights': ['The code block is responsible for parsing the form data, including gathering and cleansing the posted variables using MySQL real escape string, emphasizing the necessity of the form button press for code execution.', 'The if condition ensures that the form button is pressed before parsing the form data, highlighting the requirement for the form button press for code execution.', 'The necessity of being connected to the database to use MySQL real escape string function is emphasized, as it filters the data before sending it into the database.']}, {'end': 1240.507, 'start': 1100.238, 'title': 'Php script for uploading products', 'summary': 'Explains a php script for uploading products, checking for duplicate product names, and inserting new products into a database, employing sql queries, and conditional statements.', 'duration': 140.269, 'highlights': ['The script checks for duplicate product names by querying the database and uses conditional statements to handle the result, ensuring the uniqueness of the product names being uploaded.', 'The script inserts new products into the database using SQL queries, including the product name, price, details, category, subcategory, and the date added, enhancing the functionality of the system.']}], 'duration': 253.821, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI986686.jpg', 'highlights': ['The script inserts new products into the database using SQL queries, including the product name, price, details, category, subcategory, and the date added, enhancing the functionality of the system.', 'The script checks for duplicate product names by querying the database and uses conditional statements to handle the result, ensuring the uniqueness of the product names being uploaded.', 'The code block is responsible for parsing the form data, including gathering and cleansing the posted variables using MySQL real escape string, emphasizing the necessity of the form button press for code execution.', 'The if condition ensures that the form button is pressed before parsing the form data, highlighting the requirement for the form button press for code execution.', 'The necessity of being connected to the database to use MySQL real escape string function is emphasized, as it filters the data before sending it into the database.']}, {'end': 1727.829, 'segs': [{'end': 1272.147, 'src': 'embed', 'start': 1240.507, 'weight': 1, 'content': [{'end': 1245.569, 'text': 'which will let you know what the auto-incremented ID is for that item just placed in.', 'start': 1240.507, 'duration': 5.062}, {'end': 1247.73, 'text': 'You can gather that into a variable.', 'start': 1245.589, 'duration': 2.141}, {'end': 1255.403, 'text': 'Then you claim a new variable called new name is equal to product ID dot jpeg.', 'start': 1248.882, 'duration': 6.521}, {'end': 1262.685, 'text': "That's going to be for when you move the file that they upload, which is the jpeg image that's going to be the product image.", 'start': 1256.423, 'duration': 6.262}, {'end': 1272.147, 'text': 'So you move uploaded file, and you gather the file by using this information, file field, temp name.', 'start': 1264.145, 'duration': 8.002}], 'summary': 'Retrieve auto-incremented id for product and move uploaded jpeg file.', 'duration': 31.64, 'max_score': 1240.507, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI1240507.jpg'}, {'end': 1413.134, 'src': 'embed', 'start': 1379.466, 'weight': 3, 'content': [{'end': 1381.828, 'text': 'This is in the Learn JavaScript section.', 'start': 1379.466, 'duration': 2.362}, {'end': 1384.491, 'text': 'You can click here, Learn JavaScript.', 'start': 1382.649, 'duration': 1.842}, {'end': 1394.441, 'text': "Right here, Examples and Common Webmaster Uses, Validating HTML Forms, and that's how you apply it.", 'start': 1386.973, 'duration': 7.468}, {'end': 1403.303, 'text': 'I have a little example script showing you how to apply form validation using JavaScript to an HTML form that you have on your page,', 'start': 1395.141, 'duration': 8.162}, {'end': 1406.767, 'text': "which is what we're using on this inventory list page.", 'start': 1403.303, 'duration': 3.464}, {'end': 1413.134, 'text': "That's a simple HTML form that you can validate using JavaScript,", 'start': 1408.228, 'duration': 4.906}], 'summary': 'Learn javascript for form validation on html pages.', 'duration': 33.668, 'max_score': 1379.466, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI1379466.jpg'}, {'end': 1571.315, 'src': 'embed', 'start': 1541.585, 'weight': 0, 'content': [{'end': 1546.348, 'text': "And let's not put any, we're not going to put any value into that link just yet.", 'start': 1541.585, 'duration': 4.763}, {'end': 1550.424, 'text': "Okay, let's do the same thing for the edit word.", 'start': 1548.283, 'duration': 2.141}, {'end': 1555.747, 'text': "Make those single quotes so we don't have to escape them with the backslash.", 'start': 1551.645, 'duration': 4.102}, {'end': 1557.368, 'text': 'Now, save.', 'start': 1556.587, 'duration': 0.781}, {'end': 1564.511, 'text': "Now when you're at inventory list, you'll see edit and delete now.", 'start': 1558.268, 'duration': 6.243}, {'end': 1567.673, 'text': 'For each inventory item that comes out of there.', 'start': 1565.392, 'duration': 2.281}, {'end': 1569.494, 'text': 'And you can also get the date.', 'start': 1568.293, 'duration': 1.201}, {'end': 1571.315, 'text': 'You can access the date.', 'start': 1570.254, 'duration': 1.061}], 'summary': 'Instructions for editing links and accessing dates in inventory list.', 'duration': 29.73, 'max_score': 1541.585, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI1541585.jpg'}, {'end': 1727.829, 'src': 'embed', 'start': 1691.264, 'weight': 5, 'content': [{'end': 1696.126, 'text': 'This inventory list output line to have any information you want in it.', 'start': 1691.264, 'duration': 4.862}, {'end': 1699.707, 'text': 'And this can actually be a link to the product page.', 'start': 1697.065, 'duration': 2.642}, {'end': 1702.55, 'text': 'And I might throw that in.', 'start': 1701.529, 'duration': 1.021}, {'end': 1705.292, 'text': "But I'm not going to do it right now on video.", 'start': 1703.691, 'duration': 1.601}, {'end': 1710.177, 'text': 'All you have to do is go in and put a link tag to the product page and use this product ID.', 'start': 1705.473, 'duration': 4.704}, {'end': 1714.901, 'text': "But we haven't even set up the product page yet to do that.", 'start': 1712.319, 'duration': 2.582}, {'end': 1716.002, 'text': "So I'm not going to add it yet.", 'start': 1714.981, 'duration': 1.021}, {'end': 1720.586, 'text': "And in part 5, I'm going to show you how to edit and delete.", 'start': 1716.562, 'duration': 4.024}, {'end': 1727.829, 'text': 'each of these inventory items so when the person presses edit or they press delete will make things happen.', 'start': 1721.624, 'duration': 6.205}], 'summary': 'Inventory list includes product id, editing, and deleting in part 5.', 'duration': 36.565, 'max_score': 1691.264, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI1691264.jpg'}], 'start': 1240.507, 'title': 'Php file upload and parsing mechanism', 'summary': 'Covers php file upload, including moving and naming uploaded image files, and form validation using javascript or php. it also discusses modifying the parsing mechanism for the inventory list, adding functionality to display and manipulate inventory items, including adding the date and ordering the list by date.', 'chapters': [{'end': 1476.997, 'start': 1240.507, 'title': 'Php file upload and form validation', 'summary': 'Explains how to upload files using php, specifically moving and naming uploaded image files and implementing form validation using javascript or php.', 'duration': 236.49, 'highlights': ['You can gather the auto-incremented ID of the item just placed in and save it into a variable.', 'The uploaded jpeg image file is moved and renamed using the move_uploaded_file function, with the file name based on the product ID.', 'A tutorial is provided for validating HTML forms using JavaScript, with examples and common webmaster uses.']}, {'end': 1727.829, 'start': 1478.338, 'title': 'Parsing mechanism for inventory list', 'summary': 'Discusses modifying the parsing mechanism for the inventory list, adding functionality to display and manipulate inventory items, including adding the date and ordering the list by date.', 'duration': 249.491, 'highlights': ['The parsing mechanism for the inventory list is being modified to display and manipulate inventory items, allowing the addition of the date and ordering the list by date.', "The process involves adding spaces, bullet symbols, and links for 'edit' and 'delete' functionalities to each inventory item, which will render as 'date added - ID - product name - edit - bullet - delete'.", 'The ability to configure the inventory list output line to display any desired information and the potential for it to become a link to the product page is highlighted.', 'The upcoming part 5 will demonstrate how to edit and delete inventory items, enhancing the functionality for users.']}], 'duration': 487.322, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8dL0ntjl0fI/pics/8dL0ntjl0fI1240507.jpg', 'highlights': ['The parsing mechanism for the inventory list is being modified to display and manipulate inventory items, allowing the addition of the date and ordering the list by date.', 'The uploaded jpeg image file is moved and renamed using the move_uploaded_file function, with the file name based on the product ID.', 'You can gather the auto-incremented ID of the item just placed in and save it into a variable.', 'A tutorial is provided for validating HTML forms using JavaScript, with examples and common webmaster uses.', "The process involves adding spaces, bullet symbols, and links for 'edit' and 'delete' functionalities to each inventory item, which will render as 'date added - ID - product name - edit - bullet - delete'.", 'The ability to configure the inventory list output line to display any desired information and the potential for it to become a link to the product page is highlighted.', 'The upcoming part 5 will demonstrate how to edit and delete inventory items, enhancing the functionality for users.']}], 'highlights': ['The script inserts new products into the database using SQL queries, including the product name, price, details, category, subcategory, and the date added, enhancing the functionality of the system.', 'The parsing mechanism for the inventory list is being modified to display and manipulate inventory items, allowing the addition of the date and ordering the list by date.', 'The process involves creating an inventory list page and manipulating code for the admin area index page.', 'The file upload feature enables users to submit JPEG images, which are stored in a folder on the website with the respective product ID as the file title.', 'Using JavaScript for form validation to ensure all fields are filled before submission or data parsing.', "The process involves adding spaces, bullet symbols, and links for 'edit' and 'delete' functionalities to each inventory item, which will render as 'date added - ID - product name - edit - bullet - delete'.", 'The importance of externalizing code for reuse is highlighted, with the option to create a PHP class file or a PHP include file for this purpose.', 'The necessity of being connected to the database to use MySQL real escape string function is emphasized, as it filters the data before sending it into the database.', 'The form allows users to add new items to the inventory list on the same page, facilitating easy access and input for up to six fields of information.', 'The process of constructing the form involves wrapping an HTML form around the table, setting up form elements, and specifying the form action, method, and encoding type for data submission.']}