Cleanselol Posted February 21, 2008 Share Posted February 21, 2008 I have coded a tracking system for my guild and have come across a strange happening as of last night. The error is coming up in the section that tracks what items "bosses" have "dropped". So if you go to the Drops section you will see the query working in the first link below and the second link you will only see the bosses. Normal: http://ils.insomniaguild.org/view-raid.php?rid=438 Strange: http://ils.insomniaguild.org/view-raid.php?rid=442 Is there an ID limit I have hit where my php code is not going to be able to grab the data out with a while loop? The code is as follows: <?php // Defined classes for the alternating rows $row1 = "t"; $row2 = "ta"; $row_count = 0; ## Grabbing the Bosses function getbosses($column,$table,$where) { $sql = "SELECT $column FROM $table WHERE raid_id=$where group by $column ORDER BY drop_id ASC"; $dbh = mysql_query($sql); while($r = mysql_fetch_object($dbh)) { $arrs[$column]=$r->$column; $all[]=$arrs; } return $all; } //Get Boss $bosses=getbosses('boss','ils_raiddrops',$_REQUEST[rid]); if($bosses>0){ foreach($bosses as $key=>$boss) { ?> <tr class="rows"> <td height="22" class="t1" colspan="2"><strong><?php echo $boss[boss] ?></strong></td> </tr> <?php //Get Loot $get_loot="SELECT item_name,player_id FROM ils_raiddrops WHERE raid_id='$_REQUEST[rid]' && boss='".addslashes($boss[boss])."' ORDER BY drop_id ASC"; $get_loot_result=mysql_query($get_loot); while($loot=mysql_fetch_array($get_loot_result)) { $row_class = ($row_count % 2) ? $row1 : $row2; //Get Member $read_mem="SELECT player_id,name,class FROM ils_members WHERE player_id=$loot[player_id]"; $read_mem_result=mysql_query($read_mem); $mem=mysql_fetch_array($read_mem_result); ?> <tr class="rows"> <td class="<?php echo $row_class ?>1"><a href="profile.php?member=<?php echo $mem[0]; ?>"><span class="<?php echo $mem['class'] ?>"><?php echo $mem[1]; ?></span></a></td> <td class="<?php echo $row_class ?>1"> <?php $item = "[item]$loot[item_name][/item]"; $item = itemstats_parse($item); echo $item; ?> </td> </tr> <?php $row_count++; } } } ?> Any information would be appreciated. Quote Link to comment Share on other sites More sharing options...
DyslexicDog Posted February 21, 2008 Share Posted February 21, 2008 What is the data type on that column on your database? Does your query return the information you are looking for? have your tried using print_r on your array to see what's being returned by your query that you are having problems with? Quote Link to comment Share on other sites More sharing options...
Cleanselol Posted February 21, 2008 Author Share Posted February 21, 2008 What is the data type on that column on your database? Does your query return the information you are looking for? have your tried using print_r on your array to see what's being returned by your query that you are having problems with? drop_id [int(11)] | raid_id[int(11)] | boss [varchar(100)] | item_name [varchar(100)] | player_id [int(11)] | value [int(11)] | cost [int(11)] 5657 | 442 | Illidan Stormrage | Stormrage Signet Ring | 120 | 1 | 0 On our main page: http://www.insomniaguild.org/ bottom right you can see the rows are showing up (I have it LIMIT 4 for the main page). I am probably gonna recode it so that it's not as ghetto (it's been years since I did this). I taught myself via google / phpfreaks! and other sites. So my methods aren't disciplined I was just curious as to why the heck after hitting a certain id the loop is only grabbing the first thing out of it. Quote Link to comment Share on other sites More sharing options...
Cleanselol Posted February 27, 2008 Author Share Posted February 27, 2008 Bumping allowed here? Could really use some help with this weird bug. Quote Link to comment Share on other sites More sharing options...
redarrow Posted February 27, 2008 Share Posted February 27, 2008 $sql = "SELECT $column FROM $table WHERE raid_id='$where' group by $column ORDER BY drop_id ASC"; Quote Link to comment Share on other sites More sharing options...
Cleanselol Posted February 27, 2008 Author Share Posted February 27, 2008 The snippet didn't work. The bug is just really weird. If you go to the earlier ID I posted you will see it working. The loop goes through for each boss. Then recently it seems like it only grabs the data for the first boss. Which is why I was asking if maybe my database might be set up wrong as it has hit some type of cap? It is still writing to the database and I am able to query out the latest drops on a different page. As you can see on the main page: http://www.insomniaguild.org/ Last night's 4 kills were logged and able to be displayed here. Same database grab here: http://ils.insomniaguild.org/view-raid.php?rid=445 and only the first bosses data is grabbed... It's so weird. I am at a loss. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.