Sorry to repost, but couldn't find the answer!

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Sorry to repost, but couldn't find the answer!

    Can anyone see what i'm doing wrong here please?

    SELECT category.CategoryID, category.Category, category.Category_Image,
    category.Category_Text, products.ProductID, products.CategoryID,
    products.Product_Title, products.Product_Description,
    products.Product_Image, products.Product_Price, Prices.ID, Prices.UserID,
    Prices.ProductID, Prices.Price, retailers.UserID, retailers.Retailer_Name,
    retailers.Retailer_Logo, retailers.username, retailers.show_prices
    FROM retailers INNER JOIN ((category INNER JOIN products ON
    category.CategoryID = products.CategoryID) INNER JOIN Prices ON
    products.ProductID = Prices.ProductID) ON retailers.UserID = Prices.UserID
    WHERE category.categoryID = MMColParam1 AND retailer.Retailer_Name =
    MMColParam2

    MMColParam1 2 Request("CategoryID")
    MMColParam2 andy Request.Cookies("ckusername")

    When i test the RS i get the 'too few parameters. Expected 2


    Thanks in advance
    Andy






    Andy Guest

  2. Similar Questions and Discussions

    1. Propabely a FAQ-question, but I can't find the answer...
      Who can tell me what's a good conversion tool from BDE (Paradox) to MySQL... It may be Shareware, but my budget is limited, so preferable...
    2. Very simple question that i can't find an answer for
      Hey everyone. I just want to be able to use the # charector in plaintext on a cold fusion page, but of course it thinks that i am trying to do...
    3. Wont Publish Site - Read Help Cannot find answer!
      I used to use Publisher 98 to design my web page. I only know a little about HTML codes. I changed software to Windows XP and Purchased Pulisher...
    4. Debug Problem with VS.NET - can't find answer
      yes, I have...sorry, I was looking for a vs.net group but couldn't find one. didn't know that there was a debugging group. "Alvin Bruney"...
    5. Re (repost): Is this a bug?
      I forgot to actually use ack vs. each below but either way I get the same behaviour... BTW I am using 1.6.8 on FreeBSD 4.8 Aryeh Friedman wrote:
  3. #2

    Default Re: Sorry to repost, but couldn't find the answer!

    Hi Andy you will have to declare your variables before you execute the SQL
    statement. Try something like this.

    <%MMColParam1 = 2 ' Request("CategoryID")
    MMColParam2 = "andy" ' Request.Cookies("ckusername")
    sql="SELECT category.CategoryID, category.Category,
    category.Category_Image,"_
    &"category.Category_Text, products.ProductID, products.CategoryID,"_
    &"products.Product_Title, products.Product_Description,"_
    &"products.Product_Image, products.Product_Price, Prices.ID,
    Prices.UserID,"_
    &"Prices.ProductID, Prices.Price, retailers.UserID,
    retailers.Retailer_Name,"_
    &"retailers.Retailer_Logo, retailers.username, retailers.show_prices"_
    &"FROM retailers INNER JOIN ((category INNER JOIN products ON"_
    &"category.CategoryID = products.CategoryID) INNER JOIN Prices ON"_
    &"products.ProductID = Prices.ProductID) ON retailers.UserID =
    Prices.UserID"_
    &"WHERE category.categoryID = MMColParam1 AND retailer.Retailer_Name ="&
    MMColParam2


    response.write(sql)

    %>



    "Andy" <AndyjhughesNOSPAM@ntlworld.com> wrote in message
    news:d35em6$cp$1@forums.macromedia.com...
    > Can anyone see what i'm doing wrong here please?
    >
    > SELECT category.CategoryID, category.Category, category.Category_Image,
    > category.Category_Text, products.ProductID, products.CategoryID,
    > products.Product_Title, products.Product_Description,
    > products.Product_Image, products.Product_Price, Prices.ID, Prices.UserID,
    > Prices.ProductID, Prices.Price, retailers.UserID, retailers.Retailer_Name,
    > retailers.Retailer_Logo, retailers.username, retailers.show_prices
    > FROM retailers INNER JOIN ((category INNER JOIN products ON
    > category.CategoryID = products.CategoryID) INNER JOIN Prices ON
    > products.ProductID = Prices.ProductID) ON retailers.UserID = Prices.UserID
    > WHERE category.categoryID = MMColParam1 AND retailer.Retailer_Name =
    > MMColParam2
    >
    > MMColParam1 2 Request("CategoryID")
    > MMColParam2 andy Request.Cookies("ckusername")
    >
    > When i test the RS i get the 'too few parameters. Expected 2
    >
    >
    > Thanks in advance
    > Andy
    >
    >
    >
    >
    >
    >

    Geo Guest

  4. #3

    Default Re: Sorry to repost, but couldn't find the answer!

    Hi, thanks for replying. Here is the actual code generated by MM

    <%
    Dim RSproducts__MMColParam1
    RSproducts__MMColParam1 = "0"
    If (Request("CategoryID") <> "") Then
    RSproducts__MMColParam1 = Request("CategoryID")
    End If
    %>
    <%
    Dim RSproducts__MMColParam2
    RSproducts__MMColParam2 = "0"
    If (Request.Cookies("ckusername") <> "") Then
    RSproducts__MMColParam2 = Request.Cookies("ckusername")
    End If
    %>
    <%
    Dim RSproducts
    Dim RSproducts_numRows

    Set RSproducts = Server.CreateObject("ADODB.Recordset")
    RSproducts.ActiveConnection = MM_Online_Brochure_STRING
    RSproducts.Source = "SELECT category.CategoryID, category.Category,
    category.Category_Image, category.Category_Text, products.ProductID,
    products.CategoryID, products.Product_Title, products.Product_Description,
    products.Product_Image, products.Product_Price FROM category INNER JOIN
    products ON category.CategoryID = products.CategoryID WHERE
    Products.CategoryID = " + Replace(RSproducts__MMColParam1, "'", "''") + "
    AND retailer.Retailer_Name = " + Replace(RSproducts__MMColParam2, "'",
    "''") + ""
    RSproducts.CursorType = 0
    RSproducts.CursorLocation = 2
    RSproducts.LockType = 1
    RSproducts.Open()

    RSproducts_numRows = 0
    %>

    But i get the 'too few parameters. Expected 1' still?

    Scratching my head

    Andy



    "Geo" <gbarrNoSpam@ibigroup.com> wrote in message
    news:d35fea$1i0$1@forums.macromedia.com...
    > Hi Andy you will have to declare your variables before you execute the SQL
    > statement. Try something like this.
    >
    > <%MMColParam1 = 2 ' Request("CategoryID")
    > MMColParam2 = "andy" ' Request.Cookies("ckusername")
    > sql="SELECT category.CategoryID, category.Category,
    > category.Category_Image,"_
    > &"category.Category_Text, products.ProductID, products.CategoryID,"_
    > &"products.Product_Title, products.Product_Description,"_
    > &"products.Product_Image, products.Product_Price, Prices.ID,
    > Prices.UserID,"_
    > &"Prices.ProductID, Prices.Price, retailers.UserID,
    > retailers.Retailer_Name,"_
    > &"retailers.Retailer_Logo, retailers.username, retailers.show_prices"_
    > &"FROM retailers INNER JOIN ((category INNER JOIN products ON"_
    > &"category.CategoryID = products.CategoryID) INNER JOIN Prices ON"_
    > &"products.ProductID = Prices.ProductID) ON retailers.UserID =
    > Prices.UserID"_
    > &"WHERE category.categoryID = MMColParam1 AND retailer.Retailer_Name ="&
    > MMColParam2
    >
    >
    > response.write(sql)
    >
    > %>
    >
    >
    >
    > "Andy" <AndyjhughesNOSPAM@ntlworld.com> wrote in message
    > news:d35em6$cp$1@forums.macromedia.com...
    >> Can anyone see what i'm doing wrong here please?
    >>
    >> SELECT category.CategoryID, category.Category, category.Category_Image,
    >> category.Category_Text, products.ProductID, products.CategoryID,
    >> products.Product_Title, products.Product_Description,
    >> products.Product_Image, products.Product_Price, Prices.ID, Prices.UserID,
    >> Prices.ProductID, Prices.Price, retailers.UserID,
    >> retailers.Retailer_Name,
    >> retailers.Retailer_Logo, retailers.username, retailers.show_prices
    >> FROM retailers INNER JOIN ((category INNER JOIN products ON
    >> category.CategoryID = products.CategoryID) INNER JOIN Prices ON
    >> products.ProductID = Prices.ProductID) ON retailers.UserID =
    >> Prices.UserID
    >> WHERE category.categoryID = MMColParam1 AND retailer.Retailer_Name =
    >> MMColParam2
    >>
    >> MMColParam1 2 Request("CategoryID")
    >> MMColParam2 andy Request.Cookies("ckusername")
    >>
    >> When i test the RS i get the 'too few parameters. Expected 2
    >>
    >>
    >> Thanks in advance
    >> Andy
    >>
    >>
    >>
    >>
    >>
    >>
    >
    >
    >


    Andy Guest

  5. #4

    Default Re: Sorry to repost, but couldn't find the answer!

    Basic SQL, text fields need to be delimited by a single quote. eg

    where myfield='foo'

    --
    Jules
    [url]http://www.charon.co.uk/charoncart[/url]
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004


    Julian Roberts Guest

  6. #5

    Default Re: Sorry to repost, but couldn't find the answer!

    Hi Jules
    Thanks for the reply............(Looking really thick), i don't get it :-(

    Andy

    "Julian Roberts" <newsg@charon.co.uk> wrote in message
    news:d35lh0$bfo$1@forums.macromedia.com...
    > Basic SQL, text fields need to be delimited by a single quote. eg
    >
    > where myfield='foo'
    >
    > --
    > Jules
    > [url]http://www.charon.co.uk/charoncart[/url]
    > Charon Cart 3
    > Shopping Cart Extension for Dreamweaver MX/MX 2004
    >
    >
    >


    Andy Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139