Warning: mysql_result(): Unable to jump to row

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Nil10
Forum Newbie
Posts: 19
Joined: Thu Jun 30, 2005 1:55 pm

Warning: mysql_result(): Unable to jump to row

Post by Nil10 »

What is this error and why does it occur?
Warning: mysql_result(): Unable to jump to row 18 on MySQL result index 3 in...

I thought I were done with my database outputtesting, but I found that only some of the links in my dynamic output, results in this error. Makes no sense to me that it is only some of them. Can anyone help?
Nil10
Forum Newbie
Posts: 19
Joined: Thu Jun 30, 2005 1:55 pm

Post by Nil10 »

Please somebody :roll: need to be done in 2 days.

This is my test page http://www.recolo.dk/move/undervisning. ... amp;s2id=1
Enter that and click the style "Funky show-jazz" and everything works fine, now try "Salsa motion" and the error occurs. Why?
Here is the code I use on the stylepage:

Code: Select all

<?

$username="???";
$password="???";
$database="???";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die("Unable to select database");

$query="SELECT Byer.*, Hold.*, Lokaler.*, Minutterfra.*, Minuttertil.*, Niveauer.*, Områder.*, Priser.*, Stilarter.*, Sæsoner.*, Timerfra.*, Timertil.*, Ugedage.*, Undervisere.*
FROM Undervisere INNER JOIN (Ugedage INNER JOIN (Timertil INNER JOIN (Timerfra INNER JOIN ((Stilarter INNER JOIN (Priser INNER JOIN (Områder INNER JOIN (Niveauer RIGHT JOIN (Minuttertil INNER JOIN (Minutterfra INNER JOIN ((Byer INNER JOIN Lokaler ON Byer.ByID = Lokaler.ByID) INNER JOIN Hold ON Lokaler.LokaleID = Hold.LokaleID) ON Minutterfra.MinutterfraID = Hold.MinutterfraID) ON Minuttertil.MinuttertilID = Hold.MinuttertilID) ON Niveauer.NiveauID = Hold.NiveauID) ON Områder.OmrådeID = Byer.OmrådeID) ON Priser.PrisID = Områder.PrisID) ON Stilarter.StilartID = Hold.StilartID) INNER JOIN Sæsoner ON (Områder.OmrådeID = Sæsoner.OmrådeID) AND (Hold.SæsonID = Sæsoner.SæsonID)) ON Timerfra.TimerfraID = Hold.TimerfraID) ON Timertil.TimertilID = Hold.TimertilID) ON Ugedage.UgedagID = Hold.UgedagID) ON Undervisere.UnderviserID = Hold.UnderviserID
WHERE ((Lokaler.LokaleID='$lkid' && Sæsoner.SæsonID='$ssid') || (Ugedage.UgedagID='$udid' && Sæsoner.SæsonID='$ssid') || (Stilarter.StilartID='$said' && Sæsoner.SæsonID='$ssid') || (Niveauer.NiveauID='$nvid' && Sæsoner.SæsonID='$ssid') || (Undervisere.UnderviserID='$uvid' && Sæsoner.SæsonID='$ssid') || (Sæsoner.SæsonID='$ssid' && Sæsoner.SæsonID='$s2id'))
ORDER BY Lokaler.LokaleID, Ugedage.UgedagID, Timerfra.Timerfra ASC";

$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

$stilartnavn2=mysql_result($result,$said,"stilartnavn");
$stilartbeskrivelse2=mysql_result($result,$said,"stilartbeskrivelse");
$område=mysql_result($result,$i,"område");
$sæsonfra=mysql_result($result,$ssid,"sæsonfra");
$sæsontil=mysql_result($result,$ssid,"sæsontil");
$seasonstart = date('d/m-Y', strtotime($sæsonfra));
$seasonend = date('d/m-Y', strtotime($sæsontil));

?>
<table width="100%">
<tr>
	<td width="10px"></td>
	<td>
<table width="100%">
<tr>
<td align="left"><b><? echo $seasonstart." - ".$seasonend.", ".$område; ?></b></td>
</tr>
<tr>
<td><br></td>
</tr>
<tr>
<td align="left"><b><? echo $stilartnavn2; ?></b><br><? echo $stilartbeskrivelse2; ?></td>
</tr>
<tr>
<td><br></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="2" class="sortable" id="1">
<tr>
<th align="left">Holdnr</th>
<th align="left">Stilart</th>
<th align="left">Niveau</th>
<th align="left">Tid</th>
<th align="left">Lokale</th>
<th align="left">Ugedag</th>
<th align="right">Underviser</th>
</tr>

<?
$i=0;
while ($i < $num) {

$sæsonid=mysql_result($result,$i,"sæsonid");
$holdnr=mysql_result($result,$i,"holdnr");
$timerfra=mysql_result($result,$i,"timerfra");
$minutterfra=mysql_result($result,$i,"minutterfra");
$timertil=mysql_result($result,$i,"timertil");
$minuttertil=mysql_result($result,$i,"minuttertil");
$alderfra=mysql_result($result,$i,"alderfra");
$aldertil=mysql_result($result,$i,"aldertil");
$niveau=mysql_result($result,$i,"niveau");
$niveauid=mysql_result($result,$i,"niveauid");
$stilartnavn=mysql_result($result,$i,"stilartnavn");
$stilartid=mysql_result($result,$i,"stilartid");
$lokale=mysql_result($result,$i,"lokale");
$lokaleid=mysql_result($result,$i,"lokaleid");
$ugedag=mysql_result($result,$i,"ugedag");
$ugedagid=mysql_result($result,$i,"ugedagid");
$undervisernavn=mysql_result($result,$i,"undervisernavn");
$underviserid=mysql_result($result,$i,"underviserid");
?>

<tr>
<td><? echo $holdnr; ?></a></td>
<td><a href="stilarter.php?ssid=<? echo $sæsonid ?>&said=<? echo $stilartid ?>" target="_self" Title="<? echo $stilartnavn; ?>"><? echo $stilartnavn; ?></a></td>
<td><? if ($niveauid=="0") {echo $alderfra." - ".$aldertil." år";} elseif ($alderfra=="0") {echo '<a href="undervisning.php?ssid=',$sæsonid,'&nvid=',$niveauid,'" target="_self" Title="',$niveau,'">',$niveau,'</a>';} else {echo $alderfra." - ".$aldertil." år, ".'<a href="undervisning.php?ssid=',$sæsonid,'&nvid=',$niveauid,'" target="_self" Title="',$niveau,'">',$niveau,'</a>';} ?></td>
<td><? echo $timerfra.":".$minutterfra." - ".$timertil.":".$minuttertil; ?></a></td>
<td><a href="undervisning.php?ssid=<? echo $sæsonid ?>&lkid=<? echo $lokaleid ?>" target="_self" Title="<? echo $lokale; ?>"><? echo $lokale; ?></a></td>
<td><a href="undervisning.php?ssid=<? echo $sæsonid ?>&udid=<? echo $ugedagid ?>" target="_self" Title="<? echo $ugedag; ?>"><? echo $ugedag; ?></a></td>
<td align="right"><a href="undervisere.php?ssid=<? echo $sæsonid ?>&uvid=<? echo $underviserid ?>" target="_self" Title="<? echo $undervisernavn; ?>"><? echo $undervisernavn; ?></a></td>
</tr>

<?
$i++;
}

echo "</table>";

?>
</td>
</tr>
</table>
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

You're calling mysql_close(); .. that closes the connection to Mysql. You can't do anything with the database result after that.

Move mysql_close(); to the end of the script.

Probably won't fix it, but it'll be a start..
Nil10
Forum Newbie
Posts: 19
Joined: Thu Jun 30, 2005 1:55 pm

Post by Nil10 »

Done and still the same as you said
Post Reply