SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2002
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    trouble calling a stored procedure within php.

    I am not sure if implemented the procedure wrong on the php end or mysql end.

    I have this simple procedure
    Code:
    Procedure check (OUT A CHAR)
    BEGIN
     SELECT "good" AS A;
    END
    I call this directy in mysql console and get the result "good" under table "A";


    In my php, I have
    PHP Code:
    ...
    $r mysql_query("CALL check());

    $r2 = mysql_result($r,0);

    echo 
    $r2
    I get this error :

    "PROCEDURE check can't be return a result set in the given context"

  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You forgot some quotes:
    PHP Code:
    $r mysql_query("call check()"); 

  3. #3
    SitePoint Zealot
    Join Date
    Oct 2002
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nope not the quotes, It's there in my original


Bookmarks

Posting Permissions

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