Hello everyone ... I am trying out something similar too but just cant get it to work
The code I have been using is as follows :
* My database is FB and the table in it is profs. The field in profs is rating
** The include/connection.php file is absolutely fine and it also echo me that the connection to the database has been successful
FOR exp.php
<?php include 'includes/connection.php'; ?>
<h2>POST</h2>
<form action="exp_process.php" method="post">
<select name="rating">
<option value="1" selected="selected">1</option>
<?php
for($i=2; $i<=10 ; $i++) {
echo '<option value="'.$i.'"> '.$i.' </option>';
}
?>
</select><br>
<input type="button" value="submit" />
</form>
FOR exp_process.php
<?php include 'includes/connection.php'; ?>
<?php
$rating = $_POST['rating'];
$query = "INSERT INTO `profs` (`rating`) VALUES (`rating`)";
$result = mysql_query($query, $connection);
if ($result) {
// Success!
echo " Success ";
} else {
// Display error message.
echo "<p>Updation Failed</p>";
echo "<p>" . mysql_error() . "</p>";
}
?>
I tried to put in values to buttons and tried everything but dont know why but just can't get it to work the way it should. Any kind of help would be appreciated Thank you