+ Reply to Thread
Results 1 to 2 of 2

Thread: Store Procedure calling problem

  1. #1
    phpasks is offline x10 Sophmore phpasks is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    145

    Exclamation Store Procedure calling problem

    I have created below store procedure
    PHP Code:
    <?php
    BEGIN
        SET 
    @sortfield str_sortfield;
        
    SET @sortorder str_sortorder;
        
    SET @min_limit str_min_limit;
        
    SET @max_limit str_max_limit;
        
        IF 
    which_query_fired '1' THEN
           SELECT count
    (*) as 'count' from bos_user_master;
        ELSEIF 
    which_query_fired '2' THEN
            SET 
    @dynamic_sql=CONCAT("SELECT bos_user_master_id,username,user_fullname,user_type,");
            
    SET @dynamic_sql=CONCAT(@dynamic_sql"date_format(last_login,'%d, %b %Y') as login, date_format(add_bos_user_date,'%d, %b %Y') as add_date from bos_user_master");
            IF @
    sortfield != 0 THEN
                 SET 
    @dynamic_sql=CONCAT(@dynamic_sql" ORDER BY ",@sortfield," ",@sortorder);
            
    END IF;
            
    SET @dynamic_sql=CONCAT(@dynamic_sql" LIMIT ", @min_limit",", @max_limit);

            
    PREPARE complete_sql FROM @dynamic_sql;
            
    EXECUTE complete_sql;
            
    DEALLOCATE PREPARE complete_sql;
        
    END IF;
    END
    ?>
    Calling This Store Procedure
    PHP Code:
    <?php
    /**** Write Store Procedure for Bos User Master Select *****************************/
            
    $query    =    "call `".$this->procedure_name."`('".$this->sortField."', '".$this->sortOrder."', '".$this->findStartPost()."', '".$this->paging_limit."', '1')";
                                                    
            
    /**** Call Store Procedure Query *****************************/            
            
    $recresult_count     =     $db->db_query($query,"sp");
            
            
    /********* START Record Fetch No. of Rows *********************/
            
    $obj_row    =    $db->db_fetch_row($recresult_count);
            
    $int_count    =    $obj_row[0];
            
            
    $db->db_free_result($recresult_count);
            
            
    /**** Write Store Procedure for Bos User Master Select *****************************/
            
    $query    =    "call `".$this->procedure_name."`('".$this->sortField."', '".$this->sortOrder."', '".$this->findStartPost()."', '".$this->paging_limit."', '2')";
            
    /**** Call Store Procedure Query *****************************/            
            
    $recresult     =     $db->db_query($query,"sp");
            
            
    /********* START Record Fetch No. of Rows *********************/
            
    $page_total     =     $db->db_num_rows($recresult);
    ?>
    I have error this page
    2014 - Commands out of sync; you can't run this command now

    call `sp_search_bos_user_master`('last_login', 'DESC', '0', '20', '2') :dunno:


    Regards,
    Asif
    Asif Khalyani
    http://www.phpasks.com

  2. #2
    phpasks is offline x10 Sophmore phpasks is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    145

    Re: Store Procedure calling problem

    Please Help Me??

    It's very urgent.

    Any one knows then reply me.
    Asif Khalyani
    http://www.phpasks.com

+ Reply to Thread

Similar Threads

  1. Slight Problem
    By rmb1993 in forum Free Hosting
    Replies: 2
    Last Post: 08-14-2008, 06:04 AM
  2. A problem with certificate
    By eon01 in forum Free Hosting
    Replies: 1
    Last Post: 07-31-2008, 01:27 PM
  3. DB number problem
    By lionheart8 in forum Free Hosting
    Replies: 5
    Last Post: 04-08-2008, 08:26 AM
  4. Problem with SMF
    By tam-iam in forum Free Hosting
    Replies: 5
    Last Post: 08-21-2007, 03:20 PM
  5. Ftp Timeout problem
    By ironcross77 in forum Free Hosting
    Replies: 7
    Last Post: 04-12-2005, 08:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers