473,385 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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=\"toppingremove.php?product=$productId&top=". $top1."\">$top1</a>

which on toppingremove.php gives me, i.e.:
http://development.traders.dk/area51...20alm.%20pizza

In toppingsremove.php I have - among others:
$price_topping = mysql_result(mysql_query("SELECT 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.php 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.php just passes the string itself as is.
I have attempted to use urlencode for toppingremove.php 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
Jul 16 '05 #1
1 6364
Andreas Paasch wrote:
Andreas Paasch wrote:
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=\"toppingremove.php?product=$productId&top=". $top1."\">$top1</a>

which on toppingremove.php gives me, i.e.:

http://development.traders.dk/area51...20alm.%20pizza

In toppingsremove.php I have - among others:
$price_topping = mysql_result(mysql_query("SELECT 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.php
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.php just passes the string itself as is.
I have attempted to use urlencode for toppingremove.php 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


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


I forgot the offset, should have read:

$price_topping = mysql_result(mysql_query("SELECT pricesmall ".
"FROM esperia ".
"WHERE top1 =
'$topping'"), 0);

Works fine now.

/Andreas
--
Registeret Linux user #292411
Jul 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Humpty Dumpty | last post by:
Hello, I've been using python for about 3 months now. Prior to that I did C++ for over 5 years. I'm wondering if my debugging techniques are too C++ oriented. E.g., it took me about 9 hrs of...
4
by: Laszlo Csabi | last post by:
Hi Folks, Can someone explain me why I'm getting the following error? The error message I got is : "Parameter count does not match Parameter Value count."
7
by: Richard Cavell | last post by:
Hi, The point of using const on a parameter to a function should be to let your compiler know that the parameter shouldn't be modified during your program. This allows you to keep your code...
10
by: CD | last post by:
Hi, I'm very new to C# and am working on using a stored procedure to MSSQL with two date parameters. The first problem I'm having is that SQL appears to be throwing an exception (or my parameters...
2
by: Julio Allegue | last post by:
I am getting the wrong Count(*) on vb.net using the ExecuteScalar . It returns all the rows. It doesn't seem to look at the WHERE clause. At the same time, I am getting the correct count on "SQL...
2
by: pbd22 | last post by:
can somebody tell me how to set a parameter of my current URL without using response.redirect? I am trying to set a parameter - ResponseId = 4 inside a while loop. is this possible? also,...
10
by: DavidSeck.com | last post by:
Hi, I am working with the Facebook API right now, an I have kind of a problem, but I don't know what I am doing wrong. So I have a few arrays, f.ex.: User albums: array(2) {
4
by: Will | last post by:
Hi Everyone, I have been having a bizarre problem when I do Run Without Debugging (I have been doing this do to the intensity of some code which runs slow when Debugging). When I run without...
2
jwwicks
by: jwwicks | last post by:
C/C++ Programs and Debugging in Linux This tutorial will give you a basic idea how to debug a program in Linux using GDB. As you are aware Visual Studio doesn’t run on Linux so you have to use...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.