Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2012
    Posts
    76
    Thanks
    61
    Thanked 0 Times in 0 Posts

    Call out a stored procedure in php

    Hello, In MySQL I have created a stored procedure like so

    Code:
    DELIMITER //
    CREATE PROCEDURE countnames(OUT total_count INT(2))
    BEGIN
      SELECT COUNT(*) INTO total_count from table where name = 'John';
    END //
    DELIMITER ;
    In MySQL I can also call it out like so

    Code:
    CALL countnames(@total_count);
    SELECT @total_count AS final_total;
    But I am not sure how to call it out in PHP. Is anybody able to help please?
    Last edited by Oatley; 03-29-2013 at 11:12 PM.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    This is the page you want: http://php.ca/manual/en/mysqli.quick...procedures.php
    There should be an example of using INOUT/OUT type on there.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •