473,624 Members | 2,216 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Insert radiobutton value into database

1 New Member
How to insert radiobutton value into the mysql?

This is addrecordfrom.p hp

Expand|Select|Wrap|Line Numbers
  1.  
  2. <form name="addsummonrecord" method="post" action="addrecordprocess.php" id="signup" onSubmit="return checkform(this);">
  3. <table width="452" border="1" align="right" cellpadding="4" cellspacing="3" bordercolor="#003093" id="table">
  4. <tr> 
  5. <td width="210" class="labelfield">Record Code:</td>
  6. <td width="211" nowrap class="field">
  7.     <input name="recordno" type="text" size="10" maxlength="3" class="fieldcellinput">
  8.          </td>
  9. </tr>
  10.  
  11.  
  12. <tr> 
  13. <td class="labelfield">Payment:</td>
  14. <td nowrap class="labelfield">
  15. <input type="radio" name="types" value="01" c>Paid
  16. <input type="radio" name="types" value="02">None </td>
  17. </tr>        
  18. </table>
  19.  
  20. <input name="submit_rec" type="submit" class="button" id="submit_rec" value="Add New Record" ><input type="reset" name="reset" value="Reset" class="button">
  21. </p>
  22. </form>
  23.  

This is addrecordproces s.php

Expand|Select|Wrap|Line Numbers
  1.  <?php 
  2.  
  3. include "connection.inc"; 
  4.  
  5. if(isset( 
  6.     Expand|Select|Wrap|Line Numbers
  •  
  •     
  •  
  • %4$s
  •  
  •     
  •  
  •  POST['submit_rec'])) {
  •  
  • $recordno = 
  •     Expand|Select|Wrap|Line Numbers
  •  
  •     
  •  
  • %4$s
  •  
  •     
  •  
  •  POST['recordno'];
  • $types = 
  •     Expand|Select|Wrap|Line Numbers
  •  
  •     
  •  
  • %4$s
  •  
  •     
  •  
  •  POST['types']; 
  •  
  •  
  • $sql = "INSERT INTO records VALUES('$recordno', '$types')";
  • $results = mysql_query($sql);
  • if (!$results) {
  • echo "Unable to store data";
  •     }
  •  
  •     mysql_close();
  •  
  • ?> 
  •  
  • My problem is...there is no radiobutton value in the database when i click the submit button..Can anyone help me?? :(
    Mar 26 '06 #1
    1 17607
    Banfa
    9,065 Recognized Expert Moderator Expert
    Firstly 'Member Introductions' was not really the correct place to post this query, may I suggest that in future you pick a more appropriate forum on this website for your queries.

    Onto your problem, unfortunately
    there is no radiobutton value in the database when i click the submit button
    has no meaning as a problem statement. You haven't given the structure of the table that you are trying to insert into, you don't really explain clearly what you mean by 'no radiobutton value' and you don't give the values you are actually getting instead of the expected values.

    This is kind of similar to me post "My computer isn't working can you tell me how to fix it", when describing a problem you need to remember to give all the detail that is
    • The code running
    • The input data to the code
    • What you were expecting to happen
    • What actually happened

    Since you trap insert errors with and output message of "Unable to store data" and you haven't said you are getting it I assume that the insert is working, therefore looking at what you have posted the new record created should end up with the value 1 or 2 in the second field of the table records, whatever that may be, corresponding to the radio button values. Is that what you are seeing?
    Mar 26 '06 #2

    Sign in to post your reply or Sign up for a free account.

    Similar topics

    8
    2840
    by: VK | last post by:
    Hi! What I'm missing in following code? Cannot get the values of radiobuttons. Starting only one class (GetVariant), it works. When I put two classes together, it doesn't. Regards, VK from Tkinter import * class GetVariant: def __init__(self): self.root = Tk()
    11
    7861
    by: William Gill | last post by:
    I am placing radiobuttons in a 4 X 4 matrix (using loops) and keep references to them in a 2 dimensional list ( rBtns ). It works fine, and I can even make it so only one button per column can be selected, by assigning each column to an intVar. In many languages a radiobutton has a property that can be directly read to see if it is selected on unselected. Tkinter radiobuttons don't seem to have any such property. Is there any way to...
    0
    4128
    by: rodrigo | last post by:
    I have a Asp.net table control that I dynamically add rows from a SQL database. Inside the table, I add radiobuttons and they all have different ID numbers according to BindChain() Looking In BindChain() Sub for the line: AddHandler Rb.CheckedChanged, AddressOf BindAssembly_Click
    3
    36174
    by: sofie | last post by:
    Hello all, I use the following javascript function in a html document to set the level of one of eight available radiobuttons. The line that's commented out works fine under IE, but I need to rewrite it so that it's W3C compliant. Reading through earlier messages I concluded I should go with getElementById but this doesn't work. What am I doing wrong? Your help is much appreciated.
    2
    1864
    by: JeffFinnan | last post by:
    <form name=form1> Load in Viewer Window: <input name="radiobutton" type="radio" value="1" checked onClick="1"> 1&nbsp;&nbsp;&nbsp; <input type="radio" name="radiobutton" value="2" onClick="2"> 2&nbsp;&nbsp;&nbsp; <input type="radio" name="radiobutton" value="3" onClick="3"> 3&nbsp;&nbsp;&nbsp; <input type="radio" name="radiobutton" value="4" onClick="4"> 4
    3
    7239
    by: dave | last post by:
    I have half a dozen web form radio buttons on a web form. Each of them is set to postback=true. However, if for instance radiobutton1 is already selected and the user selects it again, it performs a postback. I only want to do a postback if the value of the radiobutton is changed. What is the best method to accomplish this? thx dave
    0
    1293
    by: member | last post by:
    Hi, Good day.i need some help from you guys. I'm using vb.net and sql database to build my file. The purpose of this file is to view news based on deparment. Im using listbox and radiobutton list in this file. listbox- to get department names in sql table radiobutton - to get the headline news for the department name choosen
    4
    4690
    by: Jim in Arizona | last post by:
    In html and ASP, I would easily code radio buttons as needed, such as: <input type="radio" name="question1" value="1">1</input>&nbsp; <input type="radio" name="question1" value="2">2</input>&nbsp; <input type="radio" name="question1" value="3">3</input> If I use the <asp:radiobuttoncontrol, I can do this: <asp:RadioButton ID="RB1" GroupName="question1" runat="server" />1 <asp:RadioButton ID="RB2" GroupName="question1" runat="server"...
    1
    6124
    by: sheenaa | last post by:
    Hello Members, I m creating my application forms in ASP.Net 2005 C# using the backend SQL Server 2005. What i have used on forms :: ? On my first form i have used some label,textboxs,dropdownlists,radiobutton and checkbox asp standard controls. On the click event of the command button the data gets stored into the database. I have created the stored procedures for the insert,update,delete. I have...
    0
    8234
    marktang
    by: marktang | last post by:
    ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
    0
    8172
    by: Hystou | last post by:
    Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
    0
    8677
    Oralloy
    by: Oralloy | last post by:
    Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
    0
    8620
    jinu1996
    by: jinu1996 | last post by:
    In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
    0
    8474
    tracyyun
    by: tracyyun | last post by:
    Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
    0
    5563
    by: conductexam | last post by:
    I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
    0
    4079
    by: TSSRALBI | last post by:
    Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
    1
    2605
    by: 6302768590 | last post by:
    Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
    2
    1482
    bsmnconsultancy
    by: bsmnconsultancy | last post by:
    In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

    By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

    To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.