0

hi everybody,

i created three table planbook,like and user table.
what is the problem in this code.
nothing to error msg display.but did not like count store in database

class planbook

public function  get_like_count($planbookId)
{
    $planbook_id= $planbook_id;
    $planbook_obj=Doctrine_Query::create() ->select('p.planbook_like')->from('planbook p')
    ->where('p.planbook_id =?', $planbookId);
    $result=$planbook_obj->fetchArray();


}

  public function add_like_count($planbookId)
  {
     $stmt=mysqli_prepare($this->connection,"update planbook set planbook_like=planbook_like+1 where planbook_id=?");
     mysqli_stmt_bind_param($stmt,'i',$planbookId);
     $this->throwExceptiononError();
     mysqli_stmt_excute($stmt);
     $this->throwExceptionOnError();
     return true;





class LikeTable extends Doctrine_Table
{
    /**
     * Returns an instance of this class.
     *
     * @return object LikeTable
     */


     public function  addlike($persoanlId,$planbookId)
     {
         $like= new Like();
         $like->setPersonalId($personalId);
         $like->setPlanbookId($planbookId);
          $like->save();

     }

javascript.

function like_add(planbook_id)
{

    $.ajax({
   url:  $(".planbook").html(),
 type: 'POST',
                data: { personalId:personalId,  planbookId:planbookId },
 success: function(data, textStatus, jqXHR){
               like_get(planbook_id);
                       }
    });


}


function like_get(planbook_id) {

 $.ajax({
 url: $('.planbook').html(),
 type: 'POST',
                data: { personalId:personalId,  planbookId:planbookId },
                success: function(data, textStatus, jqXHR){
   $('#planbook_'+planbook_id+'_likes').text(Data);

       }
    });


}
2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by baig772
0

Its not updating or inserting in Likes table? manually run your queries by echoing it and see what you get?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.