Posts

Showing posts with the label MYSQL

Insert Form DATE value into MySQL in PHP

Image
How to Insert Form DATE value into MySQL in PHP       This tutorial shows how to insert HTML date widget value into MySQL database in PHP,  when the user selects the date from the HTML form date widget/date picker, it will display the date in a dd-mm-yyyy format, whereas MySQL date format is yyyy-mm-dd . For this, PHP converts the date into MySQL supportable format and inserts into the database.  This is explained step by step in this tutorial. Where we will take the input type as date and insert date value in MySQL database using PHP when the form submitted by using method POST. For this, I have used a simple HTML Form for user interface.   Step 1: Create a table: tbl_users in your Database (MySQL) as follows:   -- -- Table structure for table `tbl_users` --   CREATE TABLE `tbl_users` ( `id` int ( 11 ) NOT NULL , `username` varchar ( 30 ) NOT NULL , `dob` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;   Step 2: ...

Working with phpmyadmin tool

Image
Working with PhpMyAdmin in XAMPP What is PhpMyAdmin in PHP PhpMyAdmin is a GUI(Graphical User Interface) tool for MySQL Database. This is bundled with Xampp, no need to install separately. Why we Use it  Database management. Tables structure management     How to Open PhpMyAdmin First open XMPP control panel Start Apache server next Start the MySQL server and click on the admin button of MySQL server. Or you can open with the link: http://localhost/phpmyadmin/ Creating Databases Click on Databases Tab  In create database box, enter the name of the database and click create button         Creating Table Click on Database " usersdb". In the bottom in create table box, enter table name and number of columns and click on Go. In the next window provide all the field names, field datatype, field size and click on Save. Specifying Field names, Data Types and sizes For table register field details are as given below   id      ...

Learn SQL Queries Part2

Image
    Learn SQL Queries using  MySQL Database Part-2 ←Part-1 In a previous blog, we have gone through the introduction of RDBMS and SQL Language . This article lets you know how to work with databases using different types of  SQL Queries.  As  we discussed  earlier, SQL Queries are grouped into 3 categories. In this tutorial, we are going to learn each of them in detail.    Table of contents  DDL Queries   CREATE     ALTER   DROP  DML Queries   SELECT Statement    INSERT Statement   UPDATE Statement   DELETE Statement  DCL Queries   GRANT  REVOKE   1. DDL Queries   TopMenu 1. Creating command:  Used to create database and tables   CREATE Database < Database - name > CREATE Database SampleDB syntax:     CREATE TABLE < Table - name > ( col1 data_type (size), col2 data_type (size), col3 data_type (size) ); example: ...