SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot pnathan's Avatar
    Join Date
    Sep 2001
    Location
    Amsterdam
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP, Stored Procedures and MS SQL

    Ok, I got a interesting problem.

    I currently have a number of stored procedures that I pass paramaters to. Everything is working fine, however, there are certain parameters that I cannot pass to these Stored Procedures:

    PHP Code:
    $Query_wp = ("EXECUTE sp_Product_All $ID");
    $Result_wp=mssql_query($Query_wp);
    $Row_wp mssql_fetch_object($Result_wp); 
    Now say from the Query above, I get the following variable:

    PHP Code:
    $Row_wp->Web_Product 
    Everything is cool, but then I have a problem when I try to envoke my Stored Procedure:

    [sql]
    CREATE PROCEDURE sp_Product_All @Row_wp->Product int
    AS
    SELECT ID, Articlenumber, Web_Name, Image FROM Product
    WHERE ID=@Row_wp->Product
    GO
    [/sql]

    I am getting an syntax error for @Row_wp->Product. I have tried variations of this syntax, but no joy. Any suggestions?

    Thanks.
    I have two tickets to the Crows, sweet.

  2. #2
    SitePoint Addict lveale's Avatar
    Join Date
    Jun 2001
    Location
    Dublin
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Should it be @Row_wp->Web_Product rather than @Row_wp->Product?

    I haven't used MSSQL stored procedures although I have used Oracle. I remember finding some good information on:
    http://www.phpbuilder.com
    and
    http://www.faqts.com/knowledge_base/index.phtml/fid/51/

  3. #3
    SitePoint Zealot pnathan's Avatar
    Join Date
    Sep 2001
    Location
    Amsterdam
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nah, I did a work around. I just rename the URLs before I call them in the Stored Procedure:

    $WebProduct = @Row_wp->Web_Product;

    Thanks for the URL's.
    I have two tickets to the Crows, sweet.


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
  •