Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

insert radio to mysql database using php

Posted on 2008-10-15
6
Medium Priority
?
299 Views
Last Modified: 2013-12-13
Hi
if i have this example that ara sent me:
<input type="radio" name="first" value="Red"> Red<br>
<input type="radio" name="first" value="White"> White<br>
<input type="radio" name="first" value="Blue"> Blue<br>
 
<input type="radio" name="second" value="Grey"> Grey<br>
<input type="radio" name="second" value="Yellow"> Yellow<br>
<input type="radio" name="second" value="Dark"> Dark<br>

and if i want to insert to my table the choices that client did
ex: he have chosen :red and yellow and i have in my table field called choice
can i do this
insert the value to my field (how i can insert theses choices into my database
0
Comment
Question by:asaidi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 4

Expert Comment

by:Ara-
ID: 22719765
Which columns / fields to the table have?
0
 

Author Comment

by:asaidi
ID: 22719791
i have a table called description

there is id ,description choice1,choice2,choice3
then client if he has chosen (ex:the fisrt choice is white then it will be added to choice1,then he choosed grey it will be added to choice 2 and so...
0
 
LVL 4

Expert Comment

by:Ara-
ID: 22719817
You can extract the results in php with:
$_REQUEST["name"];

Where name is first and second.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 4

Expert Comment

by:Ara-
ID: 22719833
The SQL statement would be something like:
INSERT INTO description VALUES(id, description, choice1, choice2);
id can be exchanged with NULL if it is an auto_increment.
Remember to enclose strings with quotes.
0
 

Author Comment

by:asaidi
ID: 22719853
can you check my web page i did :

http://83.71.142.153/feedback/feedback.php and you will see the choices i have
0
 
LVL 4

Accepted Solution

by:
Ara- earned 2000 total points
ID: 22719891
I tried filling in the fields and submit. I get a page not found.
<FORM METHOD="POST" ACTION="--WEBBOT-SELF--">
The action should contain the webpage that will process the input. E.g. a new php-page (ACTION="results.php").

The results.php file should then get the variables which seems to be:
$_REQUEST["T2"] for Client
$_REQUEST["T1"] for Date
$_REQUEST["T3"] for Project
$_REQUEST["T4"] for Job No
$_REQUEST["R1"] for Choice 1 (Communication)
$_REQUEST["R2"] for Choice 2 (Availability)
and so forth..

You then need to make the php script connect to the database and insert these values.

Check out this page if you need to:
http://www.php-mysql-tutorial.com/
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question