Ok finished making the DB and the backend script is done
now Im working on adding to a profile.
Below is code I put on a users profile that will make the rate table if they don't have one for there profile, but I want to do more here.
$query=mysql_query("SELECT u FROM friend_votes WHERE u='$profileid'")or die(" Error: ".mysql_error());
if (mysql_num_rows($query) == 0) {
$sql = "INSERT INTO friend_votes (`u`,`times`, `total`) VALUES ('$profileid', '0', '0')";
$result = mysql_query($sql);
}
I need to also select the total field from friend_votes and show it like "Rated 234 Points"
I need to SELECT $myid from friend_votes_who WHERE t=$profileid AND f=$myid and if a result exist, I would like to not show rate form and if no resul, then show my rate form
any help with best optimized code for this would be appreciated very much 🙂