Debugging - wrong parameter count

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andreas Paasch

    Debugging - wrong parameter count

    I've got somehow a little peculiar problem and can't seem to find the right
    solution so I could use a hand/hint or two.

    On toppings.php I have - among others:
    <a href=\"toppingr emove.php?produ ct=$productId&t op=".$top1."\"> $top1</a>

    which on toppingremove.p hp gives me, i.e.:


    In toppingsremove. php I have - among others:
    $price_topping = mysql_result(my sql_query("SELE CT pricesmall ".
    "FROM esperia ".
    "WHERE top1 = '$topping'"));

    Prior to retrieving $price_topping I retrieve another single value with
    almost the exact same syntax and that doesn't give me any problem.

    Attempting to retrieve the value $price_topping unfortunately ends up in:

    "Warning: Wrong parameter count for mysql_result() in toppingremove.p hp on
    line 78"

    Where line 78 exactly and solely contains: "WHERE top1 = '$topping'"));

    This problem occurs only when the string passed over as top either contains
    danish special characters or a longer string with spaces and those special
    danish characters. I haven't encountered this problem with ASCII based
    strings.

    However, I have a page toppingsadd.php that performs the similar procedure
    just reversed and doesn't encounter this peculiar problem.
    The main difference is that for toppingadd.php I use urlencode($top) as top
    while toppingremove.p hp just passes the string itself as is.
    I have attempted to use urlencode for toppingremove.p hp as well to see if
    that would solve the problem however, it didn't make any difference.

    I've been around php.net to see if I could locate some hints as to what
    caused this and what could solve it, so far I didn't localize anything of
    help.

    If someone more experienced then me could give me a hand or hint I'd be
    happy again.

    TIA,

    /Andreas

    --
    Registeret Linux user #292411
  • Andreas Paasch

    #2
    Re: Debugging - wrong parameter count - SOLVED

    Andreas Paasch wrote:
    [color=blue]
    > Andreas Paasch wrote:
    >[color=green]
    >> I've got somehow a little peculiar problem and can't seem to find the
    >> right solution so I could use a hand/hint or two.
    >>
    >> On toppings.php I have - among others:
    >> <a href=\"toppingr emove.php?produ ct=$productId&t op=".$top1."\"> $top1</a>
    >>
    >> which on toppingremove.p hp gives me, i.e.:
    >>[/color]
    >[/color]
    http://development.traders.dk/area51...20alm.%20pizza[color=blue][color=green]
    >>
    >> In toppingsremove. php I have - among others:
    >> $price_topping = mysql_result(my sql_query("SELE CT pricesmall ".
    >> "FROM esperia ".
    >> "WHERE top1 =
    >> '$topping'"));
    >>
    >> Prior to retrieving $price_topping I retrieve another single value with
    >> almost the exact same syntax and that doesn't give me any problem.
    >>
    >> Attempting to retrieve the value $price_topping unfortunately ends up in:
    >>
    >> "Warning: Wrong parameter count for mysql_result() in toppingremove.p hp
    >> on line 78"
    >>
    >> Where line 78 exactly and solely contains: "WHERE top1 = '$topping'"));
    >>
    >> This problem occurs only when the string passed over as top either
    >> contains danish special characters or a longer string with spaces and
    >> those special danish characters. I haven't encountered this problem with
    >> ASCII based strings.
    >>
    >> However, I have a page toppingsadd.php that performs the similar
    >> procedure just reversed and doesn't encounter this peculiar problem.
    >> The main difference is that for toppingadd.php I use urlencode($top) as
    >> top while toppingremove.p hp just passes the string itself as is.
    >> I have attempted to use urlencode for toppingremove.p hp as well to see if
    >> that would solve the problem however, it didn't make any difference.
    >>
    >> I've been around php.net to see if I could locate some hints as to what
    >> caused this and what could solve it, so far I didn't localize anything of
    >> help.
    >>
    >> If someone more experienced then me could give me a hand or hint I'd be
    >> happy again.
    >>
    >> TIA,
    >>
    >> /Andreas
    >>[/color]
    >
    > Sorry, even with ASCII based text this happens, so I have a major bug
    > hanging and just can get it found properly to fix it.
    >
    > /Andreas[/color]

    I forgot the offset, should have read:

    $price_topping = mysql_result(my sql_query("SELE CT pricesmall ".
    "FROM esperia ".
    "WHERE top1 =
    '$topping'"), 0);

    Works fine now.

    /Andreas


    --
    Registeret Linux user #292411

    Comment

    Working...