Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder
    Join Date
    Aug 2005
    Posts
    1,119
    Thanks
    2
    Thanked 1 Time in 1 Post

    Wrong parameter count for mysql_query

    this is my code:

    PHP Code:
    $biggestreferer 'SELECT referer, COUNT(*) AS p FROM admin_stats WHERE referer != "" GROUP BY referer ORDER BY p DESC LIMIT 1';
                
    $biggestreferer mysql_query($biggestreferer) or exit (mysql_error());
                
    $biggestreferer mysql_result($biggestreferer); 
    and it is for some reason returning a php error, not a mysql error. Mysql doesn't have a problem with the query and i have tried it in phpmyadmin and it works. Here is my php error:

    Warning: Wrong parameter count for mysql_result() in /raid5/home/eli/public_html/newhome/administration/stats.php on line 35
    What is the problem with this?

  • #2
    Regular Coder
    Join Date
    May 2006
    Posts
    101
    Thanks
    0
    Thanked 1 Time in 1 Post
    you forget to pass row param in mysql_result statement.
    Code:
    $biggestreferer = mysql_result($biggestreferer,0);

  • #3
    Regular Coder
    Join Date
    Sep 2005
    Posts
    394
    Thanks
    1
    Thanked 0 Times in 0 Posts
    http://uk2.php.net/mysql_result

    Always try reading the php manual. It tells you exactly which parameters are needed.

    ~Phil~


  •  

    Posting Permissions

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