Offemedebam
New Member
Hi I have form that contains Ratings, Name, email, and comments. I am able to insert the user input data for name, email and comments. But don't know how to store the star ratings in database. Anyone please help me. thanks\[code\] <?phpif(isset($_POST['submit'])){$name = $_POST['name'];$email = $_POST['email'];$comments = $_POST['comments'];$ratings = $_POST['ratings'];$query ="insert into imakr.customer_review(name, email, comments, ratings) values('$name', '$email', '$comments', '$ratings')";$res = mysql_query($query) or mysql_error(die("couldn't connect to database")); if($res) { echo "Your feedback is saved"; } else { echo " OOPs!! there is some error. Please check the fields"; }}?><form id="customer_review" name="cust_rev"action="" method="post" onsubmit="return validate()"> <table width="535" border="0"> <tr> <td>Rate This Product: </td> <td> <span id="rateStatus">Rate Me...</span><span id="ratingSaved">Rating Saved!</span> <div id="rateMe" title="Rate Me..."> <a onclick="rateIt(this)" id="_1" title="Poor" onmouseover="rating(this)" onmouseout="off(this)"><span class="ratings">1</span></a> <a onclick="rateIt(this)" id="_2" title="Not Bad" onmouseover="rating(this)" onmouseout="off(this)"><span class="ratings">2</span></a> <a onclick="rateIt(this)" id="_3" title="Pretty Good" onmouseover="rating(this)" onmouseout="off(this)"><span class="ratings">3</span></a> <a onclick="rateIt(this)" id="_4" title="Excellent" onmouseover="rating(this)" onmouseout="off(this)"><span class="ratings">4</span></a> <a onclick="rateIt(this)" id="_5" title="Marvellous" onmouseover="rating(this)" onmouseout="off(this)"><span class="ratings">5</span></a></div> </td> </tr> <tr> <td width="129"><span class="titles">Name</span><span class="star">*</span>:</td> <td width="396"><label for="name"></label> <input type="text" name="name" id="name" /></td> </tr> <tr> <td><span class="titles">Email</span><span class="star">*</span>:</td> <td><label for="email"></label> <input type="text" name="email" id="email" /></td> </tr> <tr> <td height="61">Comments:</td> <td><label for="comments"></label> <textarea name="comments" id="comments" cols="45" rows="5" onchange="maxlength('comments', 500)"></textarea></td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" id="submit" value="http://stackoverflow.com/questions/15662722/Submit" /></td> </tr> </table> <p> </p></form>\[/code\]