and i have this code, which finds out if the user is logged in and already likes/dislikes + it also counts home many people like/dislike if you set todo=count
$query = "UPDATE likedislike SET ".$_GET['type']." = CONCAT(".$_GET['type'].", '".$session->accessid.", ') WHERE site='".$_GET['site']."'"; mysql_query($query); } } } } }
?>
where it says > echo "you_dont_".$_GET['type']; ( where $_GET['type'] is like/dislike )
I want it to add the users id which is $session->accessid and then remove them from the other type
so say type is "like"
then it would append their id to "like", and remove it from "dislike"
To remove, would this work:
PHP Code:
$sql = mysql_query("SELECT {$_GET['type']} FROM likedislike WHERE site='".$_GET['site']."'"); while( $row = mysql_fetch_array( $sql ) ) { $new_str = str_replace("{$session->accessid}, ", "", $row[$_GET['type']]); mysql_query("UPDATE likedislike SET ".$_GET['type']." = $new_str WHERE site='".$_GET['site']."'"); }
haha, sorry if that makes no sense, just finished work and I am really tired
right this is what i have come out with, It adds the users id to the "dislike", but it will not remove it from the "like"... can one of you correct it for me please
---------------------------------------------- EDIT
I have gone over the code about 20 times, and I cannot see a problem with it ... I thinks me needs Coffee
Bookmarks