Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
bullet form not updating database
Old 01-17-2010, 06:44 AM bullet form not updating database
Webmaster Talker

Posts: 611
Trades: 0
i cant make this bullet choices form to work, it doesnt add the "good" "ok" variables to the database. any help greatly appreciated. thanks. derek
here is the code.

Code:
<?php
include("connect1.php");

////////////////////////////////////////
////////////////////////////////////////

/// query db and loop through rows example
$id     = $_POST['id'];
$field2 = $_POST['friend'];
$field3    = $_POST['zip'];
$field4    = $_POST['loyalty'];
$field5    = $_POST['courtesy'];
$field6    = $_POST['stability'];
$field7 = $_POST['attitude'];
 


 
        
     
     
         mysql_query("INSERT INTO friendgrade (friend,zip,loyalty,courtesy , stability, attitude)VALUES('$field2','$field3','$field4','$field5','$field6' , '$field7')");
        
 
       


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Update Statement</title>
<style type="text/css">
<!--
.style1 {color: #990000}
.style2 {color: #0066FF}
.style3 {color: #0000CC}
.style4 {color: #993399}
-->
</style>
</head>

<body>

 </p>
<p><span class="style2">*If updating a row, please enter the ID of the row you want to update, and enter the data</span><br /> 
  <br /> 
  <span class="style3">*If adding a new row of data , just leave the ID space blank</span><br /> 
  <br />
  <span class="style4">*To delete a row of data, click on the id of the row to delete</span><br /> 
</p>
<form id="form1" name="form1" method="post" action="">

  <table width="90%" border="0">
    <tr>
      <td>ID</td>
      <td><input name="id" type="text" id="id" /></td>
    </tr>
    <tr>
      <td>Friend</td>
      <td> 
        <input name="friend" type="text" id="friend" /></td>
    </tr>
    <tr>
      <td width="32%">zip code</td>
      <td width="68%"> 
       <input name="zip" type="text" id="zip" />
       </td>
    </tr>
    <tr>
      <td>courtesy</td>
      <td>
    <input type="radio" name="group1" value="very_poor">very poor 
<input type="radio" name="group1" value="poor" checked> poor 
<input type="radio" name="group1" value="ok"> ok
<input type="radio" name="group1" value="good"> good
<input type="radio" name="group1" value="excellent"> excellent
</td> 
        </tr>
          
            <input type="radio" name="group1" value="very_poor">very poor 
<input type="radio" name="group1" value="poor" checked> poor 
<input type="radio" name="group1" value="ok"> ok
<input type="radio" name="group1" value="good"> good
<input type="radio" name="group1" value="excellent"> excellent
 </td>
        
      
     
    </tr>
    
    
    <tr>
      <td>stability</td>
      <td><input type="radio" name="group1" value="very_poor">very poor 
<input type="radio" name="group1" value="poor" checked> poor 
<input type="radio" name="group1" value="ok"> ok
<input type="radio" name="group1" value="good"> good
<input type="radio" name="group1" value="excellent"> excellent</td>
    </tr>
    <tr>
      <td>loyalty</td>
      <td><input type="radio" name="group1" value="very_poor">very poor 
<input type="radio" name="group1" value="poor" checked> poor 
<input type="radio" name="group1" value="ok"> ok
<input type="radio" name="group1" value="good"> good
<input type="radio" name="group1" value="excellent"> excellent</td>
    </tr>
    <tr>
      <td>attitude</td>
      <td><input type="radio" name="group1" value="very_poor">very poor 
<input type="radio" name="group1" value="poor" checked> poor 
<input type="radio" name="group1" value="ok"> ok
<input type="radio" name="group1" value="good"> good
<input type="radio" name="group1" value="excellent"> excellent</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="Submit" value="Submit" /></td>
    </tr>
  </table>
   
</form>


</body>
</html>

Last edited by silverglade; 01-17-2010 at 07:01 AM..
silverglade is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-17-2010, 06:55 AM Re: bullet form not updating database
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,382
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Your PHP code doesn't appear to load the related form fields.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-17-2010, 07:45 AM Re: bullet form not updating database
Webmaster Talker

Posts: 611
Trades: 0
i dont understand, could you show me an example please? here is the new code i made

Code:
<?php
include("connect1.php");

////////////////////////////////////////
////////////////////////////////////////

/// query db and loop through rows example

$field0 = $_POST['friend'];
$field1 = $_POST['zipcode'];
$field2 = $_POST['group1'];
$field3    = $_POST['group2'];
$field4    = $_POST['group3'];
$field5    = $_POST['group4'];
$field6    = $_POST['group5'];
 
 


 
        
     
     
         mysql_query("INSERT INTO friendgrade (friend,zip,loyalty,courtesy , stability, attitude)VALUES('$field0' , '$field1', '$field2','$field3','$field4','$field5', '$field6' )");
        
 
       


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Update Statement</title>
<style type="text/css">
<!--
.style1 {color: #990000}
.style2 {color: #0066FF}
.style3 {color: #0000CC}
.style4 {color: #993399}
-->
</style>
</head>

<body>

 </p>
<p><span class="style2">*If updating a row, please enter the ID of the row you want to update, and enter the data</span><br /> 
  <br /> 
  <span class="style3">*If adding a new row of data , just leave the ID space blank</span><br /> 
  <br />
  <span class="style4">*To delete a row of data, click on the id of the row to delete</span><br /> 
</p>
<form id="form1" name="form1" method="post" action="">

  <table>
     
    <tr>
     <td>Friend</td>
      <td><input name="friend" type="text" id="friend" /></td>
    </tr>
    <tr>
      <td>Zip code</td>
      <td> 
        <input name="zipcode" type="text" id="zipcode" /></td>
    </tr>
     
    <tr>
      <td>courtesy </td>
 <td>
    <input type="radio" name="group1" value="very poor">very poor 
<input type="radio" name="group1" value="poor"> poor 
<input type="radio" name="group1" value="ok"> ok
<input type="radio" name="group1" value="good"> good
<input type="radio" name="group1" value="excellent"> excellent</td> 
        </tr> 
          
           
      
     
    </tr>
    
    
    <tr>
      <td>stability</td>
      <td><input type="radio" name="group3" value="very poor">very poor 
<input type="radio" name="group3" value="poor"> poor 
<input type="radio" name="group3" value="ok"> ok
<input type="radio" name="group3" value="good"> good
<input type="radio" name="group3" value="excellent"> excellent</td>
    </tr>
    <tr>
      <td>loyalty</td>
      <td><input type="radio" name="group4" value="very poor">very poor 
<input type="radio" name="group4" value="poor"> poor 
<input type="radio" name="group4" value="ok"> ok
<input type="radio" name="group4" value="good"> good
<input type="radio" name="group4" value="excellent"> excellent</td>
    </tr>
    <tr>
      <td>attitude</td>
      <td><input type="radio" name="group5" value="very poor">very poor 
<input type="radio" name="group5"  value="poor"> poor 
<input type="radio" name="group5" value="ok"> ok
<input type="radio" name="group5" value="good"> good
<input type="radio" name="group5" value="excellent"> excellent</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="Submit" value="Submit" /></td>
    </tr>
  </table>
   
</form>


</body>
</html>

Last edited by silverglade; 01-17-2010 at 07:52 AM..
silverglade is offline
Reply With Quote
View Public Profile
 
Old 01-17-2010, 08:16 AM Re: bullet form not updating database
Webmaster Talker

Posts: 611
Trades: 0
nevermind thanks i got it to work with the following code

Code:
<?php
include("connect1.php");

////////////////////////////////////////
////////////////////////////////////////

/// query db and loop through rows example
$id    = $_POST['id'];
$field2 = $_POST['friend'];
$field3   = $_POST['zip'];
$field4   = $_POST['grade1'];
$field5   = $_POST['grade2'];
$field6   = $_POST['grade3'];
$field7 = $_POST['grade4'];
 


 
      
    
    
       mysql_query("INSERT INTO friendgrade (friend,zip,loyalty,courtesy , stability, attitude)VALUES('$field2','$field3','$field4','$field5','$field6' , '$field7')");
      
 
       


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Update Statement</title>
<style type="text/css">
<!--
.style1 {color: #990000}
.style2 {color: #0066FF}
.style3 {color: #0000CC}
.style4 {color: #993399}
-->
</style>
</head>

<body>

 </p>
 <div align="center">WELCOME TO THE FRIENDGRADER</div>
<p>Please enter a friend, their zip code, and rate them with the following criteria.<span class="style4"></span><br />
</p>
<form id="form1" name="form1" method="post" action="">

  <table width="90%" border="0">
    
    <tr>
      <td>Friend</td>
      <td>
        <input name="friend" type="text" id="friend" /></td>
    </tr>
    <tr>
      <td width="32%">zip code</td>
      <td width="68%">
       <input name="zip" type="text" id="zip" />
      </td>
    </tr>
    <tr>
      <td>courtesy</td>
      <td><table width="345">
        <tr>
          <td width="337"><label>
            <input type="radio" name="grade1" value="very poor" id="RadioGroup1_0" />
            very poor
            <input type="radio" name="grade1" value="poor" id="RadioGroup1_1" />
poor
<input type="radio" name="grade1" value="ok" id="RadioGroup1_2" />
ok
<input type="radio" name="grade1" value="good" id="RadioGroup1_3" />
good
<input type="radio" name="grade1" value="excellent" id="RadioGroup1_4" />
excellent
</label></td>
        </tr>
       
      </table>
      </td>
    </tr>
   
   
    <tr>
      <td>stability</td>
      <td><input type="radio" name="grade2" id="very_poor3" value="very_poor" />
very poor
  <input type="radio" name="grade2" id="poor3" value="poor" />
poor
<input type="radio" name="grade2" id="ok3" value="ok" />
ok
<input type="radio" name="grade2" id="good3" value="good" />
good
<input type="radio" name="grade2" id="excellent3" value="excellent" />
excellent</td>
    </tr>
    <tr>
      <td>loyalty</td>
      <td><input type="radio" name="grade3" id="very_poor4" value="very_poor" />
very poor
  <input type="radio" name="grade3" id="poor4" value="poor" />
poor
<input type="radio" name="grade3" id="ok4" value="ok" />
ok
<input type="radio" name="grade3" id="good4" value="good" />
good
<input type="radio" name="grade3" id="excellent4" value="excellent" />
excellent</td>
    </tr>
    <tr>
      <td>attitude</td>
      <td><input type="radio" name="grade4" id="very_poor5" value="very_poor" />
very poor
  <input type="radio" name="grade4" id="poor5" value="poor" />
poor
<input type="radio" name="grade4" id="ok5" value="ok" />
ok
<input type="radio" name="grade4" id="good5" value="good" />
good
<input type="radio" name="grade4" id="excellent5" value="excellent" />
excellent</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="Submit" value="Submit" /></td>
    </tr>
  </table>
   
</form>


</body>
</html>
silverglade is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to bullet form not updating database
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.36194 seconds with 12 queries