UrbanPro

Learn PHP from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How do I insert values to database from 3 dropdown lists in a single insert query on the click of a button using PHP and MySQL?

Asked by Last Modified  

2 Answers

Learn PHP

Follow 2
Answer

Please enter your answer

Hi Abinaya You can insert data using single Insert query. You need to take 3 variables and get the value of each drop down using $_POST into the variable then use three variables in insert query. Thanks for more you can contact us.
Comments

Web Developing

$conn = mysqli_connect('127.0.0.1','root',''); $db = mysqli_select_db($conn,'DataBase_Name'); $insert = "INSERT INTO `table_name`(column1,column2,column3) VALUES('dropdown1','dropdown2','dropdown3') "; $query_insert = mysqli_query($conn,$insert); if($query_insert) { echo "Inserted successfully"; } else { echo...
read more
$conn = mysqli_connect('127.0.0.1','root',''); $db = mysqli_select_db($conn,'DataBase_Name'); $insert = "INSERT INTO `table_name`(column1,column2,column3) VALUES('dropdown1','dropdown2','dropdown3') "; $query_insert = mysqli_query($conn,$insert); if($query_insert) { echo "Inserted successfully"; } else { echo "Error in inserting the Data"; } read less
Comments

Related Questions

What are global variable in php ?
Global Variable we can declare the outside the function and another page .The PHP super global variables are: $GLOBALS $_SERVER $_REQUEST $_POST $_GET $_FILES $_ENV $_COOKIE $_SESSION
Ajay
What are some good logical programming questions for php interview?
1. What is the full form of PHP and what is the PHP? Ans: the full form of PHP is Hypertext Pre-processor. Php is server-side scripting language and Its open source and freely available. PHP easily...
Rakes
0 0
5
What kind of interview questions are asked for Advanced PHP?
In Advance PHP interview questions will be related to below chapters 1) Concept of OOPS 2) Concept of MVC 3) Store procedure, Index, View, Trigger in mysql 4) Web Services 5) CMS
Manshi
As a fresher I have done Python training, but hardly getting response from any company. What should I do?
only having training in Python is not enough to be called for intervew. Better you should get real time certification course form reputed organisation with smart hand-on real project exposure. Try to have...
Yamini
0 0
6

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Recommended Articles

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Looking for PHP Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for PHP Classes?

The best tutors for PHP Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn PHP with the Best Tutors

The best Tutors for PHP Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more