Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to jump to row on MySQL result index

Status
Not open for further replies.

Nil0

Technical User
Aug 2, 2005
2
DK
I am not that expirienced in this but were finally done with code for a projekt... I thought.

This is where I test my code:

When you click the style "Funky jazz" on that page it works, but then when you click "Salsa motion" it gives the unable to jump error.
Do you know what happens and how to fix it?

Following is the code of the page that gives the error:
<?

$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);

$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>

<?
mysql_close();
?>
 
I'm pretty sure this is a PHP problem... (forum434)

Look at the mysql_result function in particular.

[cheers]
~L.
 
This is a MySQL forum, and we can't be expected to wade through reams of HTML and PHP to track down a problem which could lie anywhere.

And you didn't even have the courtesy to format your code to make it even semi-readable.

Sorry, but I won't be looking at it.
 
Sorry I did not see the php formatting function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top