Posts

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 accordin...

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...

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...