Jump to content


Photo

Warning: Wrong parameter count for mysql_result() in /home/httpd/vhosts/com/


  • Please log in to reply
1 reply to this topic

#1 oskare100

oskare100
  • Members
  • PipPipPip
  • Advanced Member
  • 69 posts

Posted 30 October 2006 - 05:55 PM

Hello,
When I rund this part of the script:
$sql13 = "select account_username from paypal_sales where txn_id = '$txn_id'";
$result13 = mysql_query($sql13) or die( mysql_error() );
$del_account_username = mysql_result($result13);
echo "Username: $del_account_username";

I get the error:
Warning: Wrong parameter count for mysql_result() in /home/httpd/vhosts/com/

What does that mean? There is a value for account_username in the table paypal_sales where the txn_id in the database is the same as the $txn_id variable in the script.

Best Regards
Oskar R

#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 30 October 2006 - 06:14 PM

mysql_result() takes a minimum of 2 parameters: the result ID and the row number. You also typically need to pass the column name of the value you're after, too:
<?php
$del_account_username = mysql_result($result13, 0, 'username');
?>

You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users