WordPress.org

Support

Support » How-To and Troubleshooting » Wrong mysql_fetch_array

Wrong mysql_fetch_array


  • function author_info() {
    $u_id = $_GET['id'];
    global $tableusers;
    $result = mysql_query("select user_nickname from $tableusers were id='".$u_id."'");
    while($r=mysql_fetch_array($result))
    {
    $nickname=$r["user_nickname"];
    echo "$nickname";
    }
    }

    I get the following error:
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\serv\www\wp-content\plugins\profile.php on line 15
    i’m using wp-profile.php?id=1
    Does anybody see what i’m doing wrong? I sure don’t … i give up

Viewing 2 replies - 1 through 2 (of 2 total)
  • When i’m online, you can see it not working @ http://schot.xs4all.nl

    Got it:
    function author_info() {
    global $tableusers;
    $u_id = $_GET[‘id’];
    $result = mysql_query(“select user_nickname from $tableusers where id='”.$u_id.”‘”);
    $r=mysql_fetch_array($result);
    echo $r[“user_nickname”];
    }
    Lock?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wrong mysql_fetch_array’ is closed to new replies.