Posts

Showing posts from February, 2022

PHP MySQL Using OOPs

Image
    Working with PHP MySQL Using OOPS   In this blog, you are going to learn how to connect with MySQL  database and perform different CRUD operations using Oops based class in PHP. This tutorial explains to you how to create a  class with some functions that are used to maintain the database.  The below given example class having some methods and uses those methods in test class to perform various operations such as listing all the users, testing admin login, deleting a record and so on.     TopMenu  1. Create a table - users with following fields: id username password email 2.  Create dbclass.php and paste the given code below and save in some folder in server. This class having the following functions: dbconn() dbclose() dbselect() dblogin($user,$pwd) dbdelete($user) dbupdate($username,$oldpassword,$newpassword) 3. Create another file dbclasstest.php as given below and run that file in a localhost. Note: Change the db details according to yours in dbclass.php in order to connect wit

Simple jQuery Slideshow tutorial

Image
How to Create a simple Image Slider using jQuery   In this tutorial, we are going to learn how to add a simple slide show to an HTML Page. This works with a basic jQuery fade-in and fade-out functions. No plugin is used. To add this, just follow the given instructions.  1 . Create HTML file 2. Add jQuery  CDN link 3. Add some images 4. Add style code. 5. Add  jQuery snippet . 6. Run File . 1. So first,  create a file with the name  index.html and paste  the given code below, and save it.    index.html <!DOCTYPE html>    <html> <head> <title>   Image Slider Demo </script> <script type= "text/javascript" src= "" ></script> <style> </style> <script type= "text/javascript" > ...   </script> </head>     <body>   <div id= "slider" > <div> <img src= "" > </div> <div> <img src= "

SQL Join Queries Tutorial

Image
  Joining tables in SQL MySQL JOINS: In this tutorial, you are going to learn how to use different types of  joins on tables. Below you will find different types of join queries with examples. Types of JOINS in SQL INNER JOIN   OUTER JOIN   LEFT OUTER JOIN RIGHT OUTER JOIN SELF JOIN         INNER JOIN –  Returns only all common rows from both the tables     TOC     Create following tables in order to test the query        Use the queries below to create tables in MySQL:   Query -T1   -- -- Table structure for table `t1` -- CREATE TABLE IF NOT EXISTS `t1` ( `sno` int ( 11 ) NOT NULL AUTO_INCREMENT, `sname` varchar ( 30 ) NOT NULL , PRIMARY KEY (`sno`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT= 4 ; -- -- Dumping data for table `t1` -- INSERT INTO `t1` (`sno`, `sname`) VALUES ( 1 , 'AAA' ), ( 2 , 'BBB' ), ( 3 , 'CCC' );     Query -T2        TOP     -- -- Table structure for table `t2` -- CREATE TABLE IF NOT

Form Validation using jQuery plugin

Image
Form validation using jQuery validate.js plugin   In this article, you are going to learn how to use a jQuery validate.js plugin to validate HTML form fields. Before  working on form validations, you need to add these files to your program. One is validate.js  and the other one is core jQuery core library. In this, we are using only CDN links. If you are working in project, then directly download  from here and add to the project. https:// ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js https://ajax.aspnetcdn.com/ajax/jquery.validate/1.19.3/jquery.validate.min.js   Add the above links in a script. Just copy above link and paste  in  a script tag's src="" attribute. In this example, just validating name and email. This example gives you how to use plug in and validate form fields. jQuery's script calling the plugin method validate(). This method taking an array as an  argument, which is having  two array elements, one is rules and messages . rules → defin