mysql - PHP Follow Unfollow Tracking -


so i'm looking track followed , unfollowed users.

so here i've got button post the id's of stuff , user:

<form action='/follow_test.php' method='post'>     <input style='display:none;' name='stuffid' type='text' value='".$cover['stuffid']."'>     <input style='display:none;' name='userid' type='text' value='".$userid."'>     <input type='submit' name='follow' value='follow'> </form> 

follow_test.php

if(isset($_post['follow']))  {     $comicid_ = trim($_post['stuffid']);     $userid_ = trim($_post['userid']);      try {         $conn = new pdo("mysql:host=$host;dbname=$db_name", $username, $password);         $conn->setattribute(pdo::attr_errmode, pdo::errmode_exception);         $ac = $conn->prepare( "insert following(stuffid,userid)                                  values(:stuffid,:userid)");          $ac->execute(array(             "stuffid" => $stuffid_,             "userid" => $userid_         ));      } catch ( pdoexception $ex ) {         echo $ex->getmessage();     } } else {  } 

once click follow button page refreshes , id's added database. i'm not sure how check if user following stuff , change follow unfollow. know jquery eg: $("follow").text();

i pull id's user following sql join , put them in array, still don't know id's once have them. run foreach loop , check them against id's on page?

i have sourced many sites trying find answer , i've hit wall.

http://www.9lessons.info/2009/04/exactly-twitter-like-follow-and-remove.html closest have gotten.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -