SlideShare a Scribd company logo
A Step by Step approach for
PHP-MySQL Connectivity Using XAMPP Server
Step I
Downloading and
Installing XAMPP
What we Require?
1. XAMPP Server(32 bit/64 bit)
2. Editor(Notepad++/Netbeans)
3. Any Latest Browser(Internet
Explorer/Chrome/Mozila Firefox)
• Download Latest Version of XAMPP(32/64 bit,
according to your machine) from apachefriends.org
• An .exe file will be downloaded after few minutes.
•
• Now Double Click on Downloaded exe file of XAMPP. It
will be started to install.
• There can a warning message shown as in following
snapshot. Just click on Ok (because it is related with user
account control, will be discussed later sometime).
• After few minutes, XAMPP will be installed.XAMPP comes with its
Control Panel. This control panel is used to start/stop any service
directly. It will prompt to open Control panel. You can open now or
later on. I will open to check the installation status of XAMPP.
• After clicking on finish, Save appropriate language.
• Now Following snapshot shows XAMPP control panel.
• Now start Apache and MySQL services by clicking on Start Buttons shown
in front of them.Now, lets check the working of server.
• Open any Browser.(I will open Chrome).
• Type localhost in address bar and hit enter.The following screen shows
successful working of XAMPP.
Step II
Creating Database and Table in
MySQL
• Open XAMPP Control Panel.It can be opened by moving to
C:xampp directory.Serach xampp-control file and click on it.
• Now click on Admin button in front of MySQL Module.It will
open MySQL database user interface in default browser as
shown.
• You can create and manage databases in this interface. It can
be also openend by typing http://localhost/phpmyadmin/ in
address bar.
MySQL Database User Interface
Creating Database
• Click on database Tab.
• Now type name of database you want to create.I type
user_account. Then click on create button.
• Now new database with name user_accounts will be created
and shown on the top in hierarchical way.
Creating Table
• Now give a tablename to be created and select number of columns. Click
on go to proceed further.
• I have typed two columns say, user_id and user_passwd for my table.Click
on save to process query. A table will be created as shown.
Step III
Connecting PHP and MYSQL to
insert into table
• Open Notepad++ to type following
coding.Save this file to C:xampphtdocs for
proper working.
Form Coding
Form Coding (user_register.php)
</head>
<body>
<form id="user_register" method="get" >
<div style="text-align:center">
<span class="label success" height="100%"><font size="4">Enter User
Id</font></span>
<input type="text" id="un" name="uname" placeholder="Enter User Name">
<br/>
<span class="label success" height="100%"><font size="4">Enter User
Id</font></span>
<input type="password" id="up" name="upasswd" placeholder="Enter
Password">
<br/><br/>
<input type="submit" name="submit" value="Add User">
Form Coding (user_register.php) cont.
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "user_accounts";
//creating connection
$con = new mysqli($servername, $username, $password, $dbname);
//checking connection status
if($con->connect_error)
{
die("Connection Failure:".$conn->connect_error);
return false;
}
Form Coding (user_register.php) cont.
if(isset($_GET['submit']))
{
$u_name=$_GET['uname'];
$u_passwd=$_GET['upasswd'];
$add_qry="insert into
users_tabs(user_id,user_passwd)values('$u_name','$u_passwd')";
if ($con->query($add_qry) === TRUE)
{
echo "User Added"."<br/>";
}
else
{echo "Error: " . $add_qry . "<br>" . $con->error;}
unset($_GET['submit']);
$con->close();
}
?>
</div></form><body></html>
Output
Database Snapshot
Conclusion
• So, hence you can execute every type of query
such as insert, select, delete and update in
MySql.
Thanks

More Related Content

What's hot

MYSQL - PHP Database Connectivity
MYSQL - PHP Database ConnectivityMYSQL - PHP Database Connectivity
MYSQL - PHP Database Connectivity
V.V.Vanniaperumal College for Women
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
manugoel2003
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
Dominic Arrojado
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
Partnered Health
 
Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1
Gheyath M. Othman
 
Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by Mukesh
Mukesh Kumar
 
PHP - Introduction to Object Oriented Programming with PHP
PHP -  Introduction to  Object Oriented Programming with PHPPHP -  Introduction to  Object Oriented Programming with PHP
PHP - Introduction to Object Oriented Programming with PHP
Vibrant Technologies & Computers
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
Mohammed Arif
 
HTML5 - Forms
HTML5 - FormsHTML5 - Forms
HTML5 - Forms
tina1357
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
Arulmurugan Rajaraman
 
Event handling
Event handlingEvent handling
Event handling
Anand Grewal
 
Php Using Arrays
Php Using ArraysPhp Using Arrays
Php Using Arrays
mussawir20
 
Introduction to HTML5 Canvas
Introduction to HTML5 CanvasIntroduction to HTML5 Canvas
Introduction to HTML5 Canvas
Mindy McAdams
 
PHP FUNCTIONS
PHP FUNCTIONSPHP FUNCTIONS
PHP FUNCTIONS
Zeeshan Ahmed
 
php
phpphp
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
Abhishek Sur
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
Bala Narayanan
 
Document Object Model
Document Object ModelDocument Object Model
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.net
MUKALU STEVEN
 
Ado.Net Tutorial
Ado.Net TutorialAdo.Net Tutorial
Ado.Net Tutorial
prabhu rajendran
 

What's hot (20)

MYSQL - PHP Database Connectivity
MYSQL - PHP Database ConnectivityMYSQL - PHP Database Connectivity
MYSQL - PHP Database Connectivity
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
 
Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1
 
Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by Mukesh
 
PHP - Introduction to Object Oriented Programming with PHP
PHP -  Introduction to  Object Oriented Programming with PHPPHP -  Introduction to  Object Oriented Programming with PHP
PHP - Introduction to Object Oriented Programming with PHP
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
HTML5 - Forms
HTML5 - FormsHTML5 - Forms
HTML5 - Forms
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Event handling
Event handlingEvent handling
Event handling
 
Php Using Arrays
Php Using ArraysPhp Using Arrays
Php Using Arrays
 
Introduction to HTML5 Canvas
Introduction to HTML5 CanvasIntroduction to HTML5 Canvas
Introduction to HTML5 Canvas
 
PHP FUNCTIONS
PHP FUNCTIONSPHP FUNCTIONS
PHP FUNCTIONS
 
php
phpphp
php
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.net
 
Ado.Net Tutorial
Ado.Net TutorialAdo.Net Tutorial
Ado.Net Tutorial
 

Similar to PHP-MySQL Database Connectivity Using XAMPP Server

How to use_000webhost
How to use_000webhostHow to use_000webhost
How to use_000webhost
IIUM
 
PHP tutorials , php tutorials for beginners , tutorials for php
PHP tutorials , php tutorials for beginners , tutorials for phpPHP tutorials , php tutorials for beginners , tutorials for php
PHP tutorials , php tutorials for beginners , tutorials for php
aimaq9a
 
Mantis Installation for Windows Box
Mantis Installation for Windows BoxMantis Installation for Windows Box
Mantis Installation for Windows Box
guest34a3a419
 
Mantis Installation for Windows Box
Mantis Installation for Windows BoxMantis Installation for Windows Box
Mantis Installation for Windows Box
Jayanta Dash
 
WASPNEWServerDecoumentation
WASPNEWServerDecoumentationWASPNEWServerDecoumentation
WASPNEWServerDecoumentation
James Willis
 
Web hosting Free Hosting
Web hosting Free HostingWeb hosting Free Hosting
Web hosting Free Hosting
Laurence Svekis ✔
 
Web hosting get start online
Web hosting get start onlineWeb hosting get start online
Web hosting get start online
Laurence Svekis ✔
 
Wamp & LAMP - Installation and Configuration
Wamp & LAMP - Installation and ConfigurationWamp & LAMP - Installation and Configuration
Wamp & LAMP - Installation and Configuration
Chetan Soni
 
Installation 02 (wp)
Installation 02 (wp)Installation 02 (wp)
Installation 02 (wp)
AbhishekMondal42
 
instaling
instalinginstaling
instaling
tutorialsruby
 
instaling
instalinginstaling
instaling
tutorialsruby
 
instaling
instalinginstaling
instaling
tutorialsruby
 
instaling
instalinginstaling
instaling
tutorialsruby
 
4th quarter 17 php & my sql registration page
4th quarter   17 php & my sql registration page4th quarter   17 php & my sql registration page
4th quarter 17 php & my sql registration page
Esmeraldo Jr Guimbarda
 
How to Install a PHP Script in cPanel.pdf
How to Install a PHP Script in cPanel.pdfHow to Install a PHP Script in cPanel.pdf
How to Install a PHP Script in cPanel.pdf
Host It Smart
 
How to Install Magento 2 On Wamp
How to Install Magento 2 On WampHow to Install Magento 2 On Wamp
How to Install Magento 2 On Wamp
Tecstub
 
Installation xampp and WordPress on localhost
Installation xampp and WordPress on localhostInstallation xampp and WordPress on localhost
Installation xampp and WordPress on localhost
Luzan Baral
 
How to install word press on local server
How to install word press on local serverHow to install word press on local server
How to install word press on local server
Himanshi Garg
 
Install Word Press with xampp
Install Word Press with xamppInstall Word Press with xampp
Install Word Press with xampp
Mehdi Sharifirad
 
How to Install and Configure Drupal CMS
How to Install and Configure Drupal CMSHow to Install and Configure Drupal CMS
How to Install and Configure Drupal CMS
darandon
 

Similar to PHP-MySQL Database Connectivity Using XAMPP Server (20)

How to use_000webhost
How to use_000webhostHow to use_000webhost
How to use_000webhost
 
PHP tutorials , php tutorials for beginners , tutorials for php
PHP tutorials , php tutorials for beginners , tutorials for phpPHP tutorials , php tutorials for beginners , tutorials for php
PHP tutorials , php tutorials for beginners , tutorials for php
 
Mantis Installation for Windows Box
Mantis Installation for Windows BoxMantis Installation for Windows Box
Mantis Installation for Windows Box
 
Mantis Installation for Windows Box
Mantis Installation for Windows BoxMantis Installation for Windows Box
Mantis Installation for Windows Box
 
WASPNEWServerDecoumentation
WASPNEWServerDecoumentationWASPNEWServerDecoumentation
WASPNEWServerDecoumentation
 
Web hosting Free Hosting
Web hosting Free HostingWeb hosting Free Hosting
Web hosting Free Hosting
 
Web hosting get start online
Web hosting get start onlineWeb hosting get start online
Web hosting get start online
 
Wamp & LAMP - Installation and Configuration
Wamp & LAMP - Installation and ConfigurationWamp & LAMP - Installation and Configuration
Wamp & LAMP - Installation and Configuration
 
Installation 02 (wp)
Installation 02 (wp)Installation 02 (wp)
Installation 02 (wp)
 
instaling
instalinginstaling
instaling
 
instaling
instalinginstaling
instaling
 
instaling
instalinginstaling
instaling
 
instaling
instalinginstaling
instaling
 
4th quarter 17 php & my sql registration page
4th quarter   17 php & my sql registration page4th quarter   17 php & my sql registration page
4th quarter 17 php & my sql registration page
 
How to Install a PHP Script in cPanel.pdf
How to Install a PHP Script in cPanel.pdfHow to Install a PHP Script in cPanel.pdf
How to Install a PHP Script in cPanel.pdf
 
How to Install Magento 2 On Wamp
How to Install Magento 2 On WampHow to Install Magento 2 On Wamp
How to Install Magento 2 On Wamp
 
Installation xampp and WordPress on localhost
Installation xampp and WordPress on localhostInstallation xampp and WordPress on localhost
Installation xampp and WordPress on localhost
 
How to install word press on local server
How to install word press on local serverHow to install word press on local server
How to install word press on local server
 
Install Word Press with xampp
Install Word Press with xamppInstall Word Press with xampp
Install Word Press with xampp
 
How to Install and Configure Drupal CMS
How to Install and Configure Drupal CMSHow to Install and Configure Drupal CMS
How to Install and Configure Drupal CMS
 

Recently uploaded

Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
devvsandy
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
ssuserad3af4
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 

Recently uploaded (20)

Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 

PHP-MySQL Database Connectivity Using XAMPP Server

  • 1. A Step by Step approach for PHP-MySQL Connectivity Using XAMPP Server
  • 3. What we Require? 1. XAMPP Server(32 bit/64 bit) 2. Editor(Notepad++/Netbeans) 3. Any Latest Browser(Internet Explorer/Chrome/Mozila Firefox)
  • 4. • Download Latest Version of XAMPP(32/64 bit, according to your machine) from apachefriends.org • An .exe file will be downloaded after few minutes. •
  • 5. • Now Double Click on Downloaded exe file of XAMPP. It will be started to install. • There can a warning message shown as in following snapshot. Just click on Ok (because it is related with user account control, will be discussed later sometime).
  • 6.
  • 7. • After few minutes, XAMPP will be installed.XAMPP comes with its Control Panel. This control panel is used to start/stop any service directly. It will prompt to open Control panel. You can open now or later on. I will open to check the installation status of XAMPP. • After clicking on finish, Save appropriate language. • Now Following snapshot shows XAMPP control panel.
  • 8. • Now start Apache and MySQL services by clicking on Start Buttons shown in front of them.Now, lets check the working of server. • Open any Browser.(I will open Chrome). • Type localhost in address bar and hit enter.The following screen shows successful working of XAMPP.
  • 9. Step II Creating Database and Table in MySQL
  • 10. • Open XAMPP Control Panel.It can be opened by moving to C:xampp directory.Serach xampp-control file and click on it. • Now click on Admin button in front of MySQL Module.It will open MySQL database user interface in default browser as shown. • You can create and manage databases in this interface. It can be also openend by typing http://localhost/phpmyadmin/ in address bar.
  • 11. MySQL Database User Interface
  • 12. Creating Database • Click on database Tab. • Now type name of database you want to create.I type user_account. Then click on create button. • Now new database with name user_accounts will be created and shown on the top in hierarchical way.
  • 13. Creating Table • Now give a tablename to be created and select number of columns. Click on go to proceed further. • I have typed two columns say, user_id and user_passwd for my table.Click on save to process query. A table will be created as shown.
  • 14. Step III Connecting PHP and MYSQL to insert into table
  • 15. • Open Notepad++ to type following coding.Save this file to C:xampphtdocs for proper working.
  • 17. Form Coding (user_register.php) </head> <body> <form id="user_register" method="get" > <div style="text-align:center"> <span class="label success" height="100%"><font size="4">Enter User Id</font></span> <input type="text" id="un" name="uname" placeholder="Enter User Name"> <br/> <span class="label success" height="100%"><font size="4">Enter User Id</font></span> <input type="password" id="up" name="upasswd" placeholder="Enter Password"> <br/><br/> <input type="submit" name="submit" value="Add User">
  • 18. Form Coding (user_register.php) cont. <?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "user_accounts"; //creating connection $con = new mysqli($servername, $username, $password, $dbname); //checking connection status if($con->connect_error) { die("Connection Failure:".$conn->connect_error); return false; }
  • 19. Form Coding (user_register.php) cont. if(isset($_GET['submit'])) { $u_name=$_GET['uname']; $u_passwd=$_GET['upasswd']; $add_qry="insert into users_tabs(user_id,user_passwd)values('$u_name','$u_passwd')"; if ($con->query($add_qry) === TRUE) { echo "User Added"."<br/>"; } else {echo "Error: " . $add_qry . "<br>" . $con->error;} unset($_GET['submit']); $con->close(); } ?> </div></form><body></html>
  • 22. Conclusion • So, hence you can execute every type of query such as insert, select, delete and update in MySql.