The purpose of this blogging site to provide coding tutorials, notes,coding tips, MCQs and code examples. You will find tutorials on various IT technologies. This site main goal is helping beginners to become developers. These programming tutorials teach you how to program, and improve coding skills. You will find tutorials on various programming languages. It may help you to shape up your coding ability. Find simple and straight forward coding techniques. Keep visiting..
Recently viewed list in PHP MySQL Learn How to show recently viewed products list in a PHP website using MySQL Database . In the previous tutorial, you learn how to get the last five product IDs in an array. In this tutorial, we use MySQL to get the details of each product from recently viewed, and display them in the bottom of the product details page. Here we're using two files, one is bookdetails.php and another is recentlyviewed.php. In Bookdetails.php bookid is added to a session array 'lastviewed' every time when user clicks on some book. bookdetails.php <?php @ session_start (); include "connect.php" ; //check if //A) a bookid has been submitted //B) the submitted value is numeric $auth = "" ; if ( isset ( $_GET [ 'bid' ])){ //clean it up if (! is_numeric ( $_GET [ 'bid' ])){ //Non numeric value entered. Someone tampered with the catid $error = true ; $errormsg = " Security, Serious error. Contact webmast...
How to show a list of recently viewed products in PHP Mostly when you are visiting ecommerce websites, you will see a short browsing history of recently view products. This list allows the user to visit back again more easily to a product page they have just seen or add it to a wishlist or as a reminder. So that they don’t forget about something which may have interested them. In this tutorial, you will learn how to display the last 5 products viewed , by storing the product ID from the product details page in an array within the session. Steps: Here are some steps that we need to follow to achieve… • Add the clicked product's ID to an array when the product detail page is visited by a user. • Store up to 5 product IDs in the array. • Skip the same product being added to the array twice. • Show the collected product IDs in an array. Step 1: Adding the product ID to an array. At the top of the product detail page, create a session, and set the value. Here, we used 'recentlyviewe...
How to implement PHP MySQL Pagination using Bootstrap4 In this tutorial, you will learn how to implement PHP MySQL Pagination using Bootstrap4. Pagination is actually the process of printing database table records in a page wise. Here is the example of pagination code using PHP and Bootstrap-4 with Next and Previous buttons. Create the following Database and table in MySQL database, in order to run the below given code. Create Database create database usersdb ; Create Table CREATE TABLE ` users ` ( ` id ` int ( 11 ) NOT NULL auto_increment , `user name ` varchar ( 100 ) NOT NULL , ` age ` int ( 3 ) NOT NULL , ` email ` varchar ( 100 ) NOT NULL , PRIMARY KEY ( ` id ` ) ); Create pagination.php in server of your choice like XMPP or WAMP and copy and paste the code and run the file. pagination.php TOP <!DOCTYPE html> <html> <head> <meta http-equiv= "Content-Type" content= "text/html; charset=utf...