Jump to content

Update MYQSL with Radio Value


doddsey_65

Recommended Posts

I am trying to update a column in the table with the selected radio value. This is for a rating system i am trying to create but it isnt working. No value is entered into said column.

 

<form name=rate action="<?php echo $_SERVER['PHP_SELF']?>?id=6" method="POST">

<input type=radio name=rate value=1>1
<input type=radio name=rate value=2>2
<input type=radio name=rate value=3 checked>3
<input type=radio name=rate value=4>4
<input type=radio name=rate value=5>5
<input type=submit name=rate value=Rate id=rate><br>
</form>

<?php

$update = $_POST['rate'];

if (isset($_POST['rate'])) {

$rated = mysql_query("UPDATE tutorials SET RatedBy = RatedBy + 1, Rating = Rating + '$update' WHERE id = 6") or die 

(mysql_error());
$res = mysql_query($rated);

 

Anyone know where Im going wrong?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.