Results 1 to 2 of 2

Thread: Mysql _ error Help a proffesional needed

  1. #1
    Join Date
    Jun 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Mysql _ error Help a proffesional needed

    I m gettin this error
    when i try to run from a server.
    www.club.phenyu.com
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\Domains\phenyu.com\SubDomains\club\game_setup.php on line 48

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\Domains\phenyu.com\SubDomains\club\game_setup.php on line 54

    Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in D:\Domains\phenyu.com\SubDomains\club\game_setup.php on line 57
    if (!isset($_GET["view"])) $view=""; else $view=$_GET["view"];
    if (!isset($_GET["play"])) $play=""; else $play=$_GET["play"];
    if (!isset($_GET["reason"])) $reason=""; else $reason=$_GET["reason"];
    if (!isset($_GET["rid"])) $rid=$play; else $rid=$_GET["rid"];

    line no 48.
    $id = mysql_fetch_array(mysql_query("SELECT id FROM $tab[user] WHERE code='$pkuser';"));
    $id = $id["id"];


    $getcensors = mysql_query("SELECT censor FROM $tab[censor];");
    $censorwords = array();

    line no.54

    while($censor=mysql_fetch_array($getcensors)) {
    array_push($censorwords, $censor[0]);
    }

    line no 57
    mysql_free_result($getcensors);
    Help needed here as i have more problem i wanna tackle 1 by one

    thank you

  2. #2
    Join Date
    May 2007
    Location
    England, UK
    Posts
    235
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default

    At first glance I noticed that this may cause you a problem:
    I've highlighted the bits in red:

    if (!isset($_GET["view"])) $view=""; else $view=$_GET["view"];
    if (!isset($_GET["play"])) $play=""; else $play=$_GET["play"];
    if (!isset($_GET["reason"])) $reason=""; else $reason=$_GET["reason"];
    if (!isset($_GET["rid"])) $rid=$play; else $rid=$_GET["rid"];

    line no 48.
    $id = mysql_fetch_array(mysql_query("SELECT id FROM $tab[user] WHERE code='$pkuser';")); // Line has been ended before the end
    $id = $id["id"];


    $getcensors = mysql_query("SELECT censor FROM $tab[censor];");
    $censorwords = array();

    line no.54

    while($censor=mysql_fetch_array($getcensors)) {
    array_push($censorwords, $censor[0]);
    }

    line no 57
    mysql_free_result($getcensors);

Bookmarks

Posting Permissions

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