SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Soo many errors in this small text :(

    PHP Code:
    <?php
    require("./global.php");

    $result mysql_query("select cheat_name, cheat_id, cheat_view from cheats_pc where cheat_view > 50");
      while(list(
    $cheat_name$cheat_id$cheat_view) = mysql_fetch_row($result)){
            
    $results mysql_query("select game_name, forum_id from game_forums where game_name=$cheat_name");
               list(
    $game_name$forum_id) = mysql_fetch_row($results);
             if (
    $game_name == null) {
               
    $result_id mysql_query ("select max(forum_id) from forum where cheat_id > '0'");
                 list(
    $forumid) = mysql_fetch_row($result_id);
                 
    $forum_id2 $forumid 1;
               
    $DB_site->query("INSERT INTO game_forums (forumid, styleid, title, description, active, displayorder, replycount, lastpost, lastposter, threadcount, allowposting, cancontainthreads, daysprune, newpostemail, newthreademail, moderatenew, moderateattach, allowbbcode, allowimages, allowhtml, allowsmilies, allowicons, parentid, parentlist, allowratings, countposts, styleoverride) VALUES ('$forum_id2', '1', '$cheat_name', '', '0', '1', '0', '0', '', '0', '1', '1', '30', '', '', '0', '0', '1', '0', '0', '1', '1', '3', '$forum_id2,3,-1', '1', '1', '0')");
               echo(
    "New forum has been made for $game_name");
             }else{
               echo(
    "A forum for $game_name already exists!");
             }
         }
    echo(
    "Completed building forums");
    ?>
    ERRORS:Warning: Supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\forum3\cheats\pc\admin\build.php on line 7

    Warning: Supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\forum3\cheats\pc\admin\build.php on line 10

    There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser.

    An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

    We apologise for any inconvenience.
    Last edited by MrLister; Jun 17, 2001 at 19:35.

  2. #2
    SitePoint Addict manipura's Avatar
    Join Date
    Apr 2001
    Location
    Calgary,AB
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There seems to be something wrong with Mysql. Try loging into MySQL and do that query, see what comes up. If nothing happens, then its your SQL line. It might also be your database alltogether.

  3. #3
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that error usually means wrong format used or i did something that i can't but mysql is fine. just odn't know where the error is or have that much inside a while.

  4. #4
    SitePoint Addict manipura's Avatar
    Join Date
    Apr 2001
    Location
    Calgary,AB
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I know this might be wrong
    list($game_name, $forum_id) = mysql_fetch_row($results);


    Just use this
    list($game_name, $forum_id) = $result;

  5. #5
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i always use the fetch row thing and it never does thief before

  6. #6
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anybody... i really need this

  7. #7
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep

    PHP Code:

            $results 
    mysql_query("select game_name, forum_id from game_forums where game_name=$cheat_name"); 
    Needs single quotes around $cheat_name

    PHP Code:
            $results mysql_query("select game_name, forum_id from game_forums where game_name = '$cheat_name'"); 
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  8. #8
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh yeah thx. i found one more minor one and now it works.


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
  •