SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
-
Jun 17, 2001, 14:02 #1
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");
?>
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 20:35.
-
Jun 17, 2001, 14:25 #2
- 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.
-
Jun 17, 2001, 16:01 #3
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.
-
Jun 17, 2001, 16:32 #4
- 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;
-
Jun 17, 2001, 18:41 #5
i always use the fetch row thing and it never does thief before
-
Jun 18, 2001, 06:55 #6
anybody... i really need this
-
Jun 18, 2001, 06:59 #7
- 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");
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.
-
Jun 18, 2001, 12:16 #8
oh yeah thx. i found one more minor one and now it works.
Bookmarks