Jump to content

Mysql error...cant find it


MrBillybob

Recommended Posts

error:


Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 7 in /home/content/t/u/b/tubguys/html/eve/index.php on line 607

Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 9 in /home/content/t/u/b/tubguys/html/eve/index.php on line 620

 

code:

	<?php 
		$sql = 'SELECT * FROM `eve_corp_list`';
		$res = mysql_query($sql, $server1);
		while($row = mysql_fetch_array($res)){
			$i++;
			$totin = 0;
			$totout = 0;

			if (!isset($day)) {
				$day = date("d");
			}	

			$name = $row['charactername'];

			$members[$name]['name'] = $row['charactername'];		

			$sql2 = 'SELECT `amount`, `ownerName2` FROM `eve_wallet` WHERE `ownerName2` = \'' . mysql_real_escape_string($row['charactername']) . '\' AND `amount` > 0 AND `date` >= \'' . $year . '-' . $month . '-' . $day . ' 00:00:00\' AND `date` <= \'' . $year . '-' . $month . '-' . $day . ' 24:00:00\'';
			$res2 = mysql_query($sql2, $server1); 
			$temptyname = mysql_result($res2, 0, 'ownerName2'); //line 607
			if ($temptyname == "") {
				$sql2 = 'SELECT `amount` FROM `eve_wallet` WHERE `ownerName1` = \'' . mysql_real_escape_string($row['charactername']) . '\' AND `amount` > 0 AND `date` >= \'' . $year . '-' . $month . '-' . $day . ' 00:00:00\' AND `date` <= \'' . $year . '-' . $month . '-' . $day . ' 24:00:00\'';
				$res2 = mysql_query($sql2, $server1);
			}
			while($row2 = mysql_fetch_array($res2)){
				$totin = $totin + $row2['amount'];
			}
			$members[$name]['posin'] = $totin;

			$sql2 = 'SELECT `amount`, `ownerName2` FROM `eve_wallet` WHERE `ownerName2` = \'' . mysql_real_escape_string($row['charactername']) . '\' AND `amount` < 0 AND `date` >= \'' . $year . '-' . $month . '-' . $day . ' 00:00:00\' AND `date` <= \'' . $year . '-' . $month . '-' . $day . ' 24:00:00\'';
			$res2 = mysql_query($sql2, $server1);
			$temptyname = mysql_result($res2, 0, 'ownerName2'); //line 620
			if ($temptyname == "") {
				$sql2 = 'SELECT `amount` FROM `eve_wallet` WHERE `ownerName1` = \'' . mysql_real_escape_string($row['charactername']) . '\' AND `amount` < 0 AND `date` >= \'' . $year . '-' . $month . '-' . $day . ' 00:00:00\' AND `date` <= \'' . $year . '-' . $month . '-' . $day . ' 24:00:00\'';
				$res2 = mysql_query($sql2, $server1);
			}
			while($row2 = mysql_fetch_array($res2)){
				$totout = $totout + $row2['amount'];
			}
			$members[$name]['posout'] = $totout;

		$count++;		
		}	
		$i = 0;
		$res = mysql_query($sql, $server1);
		while($row = mysql_fetch_array($res)){
				if ($row['charactername'] != "") {

					$totin = 0;
					$totout = 0;
					?>
					<tr>
						<td class="row<?php echo fmod($i, 2); ?>">
							<?php echo "<a href=\"?l=wallet&division=all&month=".date("m")."&year=".date("Y")."&day=".$day."&memberid=".$row['id']."&view=refer_members\">" . $members[$row['charactername']]['name'] . "</a>"; ?>
						</td>
						<td class="row<?php echo fmod($i, 2); ?>">
							<?php
							echo "<div class=\"green\">" . number_format($members[$row['charactername']]['posin'], 2, '.', ',') . "</div>";
							?>
						</td>
						<td class="row<?php echo fmod($i, 2); ?>">
							<?php
							echo "<div class=\"red\">" . number_format($members[$row['charactername']]['posout'], 2, '.', ',') . "</div>";
							?>
						</td>
						<td class="row<?php echo fmod($i, 2); ?>">
							Type Totals
						</td>
					</tr>
				<?php
				$i++;
			}
		}			
		?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.