Getting sucked into a black hole
Posted: Wed Oct 09, 2002 7:55 pm
Hello ladies and gentlemen.
I am officially in a black hole. I am writing a user rating system script that is supposed to average out all the user ratings given to a certain row. Each of my rows has a field in it called 'rating'. I have a script that lloks like this:
this script FOLLOWS this script:
Now, I want to put the rating system in the second page (the code I posted first). I know how to make the radio buttons, but I have no idea even how to begin processing them, let alone find the average of all of the votes. Oh yeah. The ratings go from 1-10.
Now, I'm not asking for you people to write me a code. I'm asking you to point me in the right direction, give me an idea of how to start this. Please don't point me to the PHP manual, but something more specific. Thanks.
I am officially in a black hole. I am writing a user rating system script that is supposed to average out all the user ratings given to a certain row. Each of my rows has a field in it called 'rating'. I have a script that lloks like this:
Code: Select all
<?php
$db = mysql_connect("localhost","","");
mysql_select_db("dbthawowi_2",$db);;
$callsign = $HTTP_POST_VARSї'id'];
$callsign = $_GETї'id'];
$query = "SELECT * FROM userjokes WHERE id='$id'";
$resultat = mysql_query($query) or die(mysql_error());
$row= mysql_fetch_object($resultat);
echo "Joke number ";
print"$row->id<br><br>";
print"$row->text<br><br>";
echo "Joke submitted by: ";
print"$row->name ";
echo "on ";
print "$row->date<br>";
?>Code: Select all
<?php
$db = mysql_connect("localhost","","");
mysql_select_db("dbthawowi_2",$db);;
$callsign = $HTTP_POST_VARSї'id'];
$sql="SELECT id, joke FROM userjokes WHERE validation='yes' ORDER BY id";
$res=mysql_query($sql, $db);
while ($row = mysql_fetch_object ($res))
{
print "<td><a href="archive2.php?id=$row->id" target="new">" . $row->id . "</a>";
}
?>Now, I'm not asking for you people to write me a code. I'm asking you to point me in the right direction, give me an idea of how to start this. Please don't point me to the PHP manual, but something more specific. Thanks.