Results 1 to 2 of 2

Thread: Mysql_result is not feeling well....T_T

  1. #1

    Thread Starter
    Hyperactive Member PlaGuE's Avatar
    Join Date
    Jun 2005
    Location
    in ur mind.
    Posts
    445

    Mysql_result is not feeling well....T_T

    okay this is really wierd... ive used this function in many scripts...

    and yet... its NOT WORKING IN THIS ONE...

    i get

    PHP Code:
    Warningmysql_result(): supplied argument is not a valid MySQL result resource in /mounted-storage/home7/sub001/sc13805-XKIN/www/deadlyjynx/etc/private.php on line 9 
    when i use this


    PHP Code:
    <?
    session_start();
    require"conn.php";
     ?>
        <?php
        
        $show 
    mysql_query("SELECT COUNT(*) AS PM FROM private_message WHERE receiver = '".$_SESSION['user']."'");

    $PM mysql_result($show0"PM");
    echo (
    "(");
    if (
    $PM 0)

    {

        echo 
    "<font color=orange>";

    }

    echo (
    "$PM");

    if (
    $PM 0)

    {

        echo 
    "</FoNt>";
    }
    echo
    ")";
    ?>
    It's really wierd that its not working... any help would be nice in solving this stupid problem.
    Without balance, there could only be chaos.
    Without chaos, there could be no balance.
    I live with karma. Eat with destiny. Dream of life without shackles....
    Yet. If life had no consequences, life could not exist, nor could it flourish.


    If at first you dont succeed.You're screwed.

    C++/Java NOOB.

    I aint a professional at PHP, but if i can help i will.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Mysql_result is not feeling well....T_T

    That error indicates that the query failed. Is the reciever column numeric? If so, take out the quotes. Also, mysql_error() is your friend
    PHP Code:
        $show mysql_query("SELECT COUNT(*) AS PM FROM private_message WHERE receiver = '".$_SESSION['user']."'");

        if (! 
    $show) {
            echo(
    mysql_error());
            die; 
        }

    $PM mysql_result($show0"PM"); 
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

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



Click Here to Expand Forum to Full Width