markspec87 Posted June 7, 2006 Share Posted June 7, 2006 Error:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: mysql_result(): Unable to jump to row 1 on MySQL result index 5 in /home/terraarm/public_html/index.php on line 108[/quote]Code:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]$query="SELECT * FROM news ORDER BY datum DESC LIMIT 1,1";$result=mysql_query($query); $num=mysql_numrows($result);$i=1;$author2=mysql_result($result,$i,"author");$text2=mysql_result($result,$i,"text");$datum2=mysql_result($result,$i,"Datum");$readmore2=mysql_result($result,$i,"readmore");$image2=mysql_result($result,$i,"image");$title2=mysql_result($result,$i,"title");$summary2=mysql_result($result,$i,"summary");?>[/quote]Any ideas whats wrong? (The DB is def setup correctly, i.e the row exists.) Link to comment https://forums.phpfreaks.com/topic/11418-warning-mysql_result-unable-to-jump-to-row-1/ Share on other sites More sharing options...
redarrow Posted June 7, 2006 Share Posted June 7, 2006 [code]$query="SELECT * FROM news ORDER BY datum DESC LIMIT 1,1";$result=mysql_query($query); $num=mysql_num_rows($result) {$i=1;$author2=mysql_result($result,$i,"author");$text2=mysql_result($result,$i,"text");$datum2=mysql_result($result,$i,"Datum");$readmore2=mysql_result($result,$i,"readmore");$image2=mysql_result($result,$i,"image");$title2=mysql_result($result,$i,"title");$summary2=mysql_result($result,$i,"summary");}?>[/code] Link to comment https://forums.phpfreaks.com/topic/11418-warning-mysql_result-unable-to-jump-to-row-1/#findComment-42820 Share on other sites More sharing options...
markspec87 Posted June 7, 2006 Author Share Posted June 7, 2006 [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Parse error: parse error, unexpected '{' in /home/terraarm/public_html/index.php on line 106[/quote]:( Link to comment https://forums.phpfreaks.com/topic/11418-warning-mysql_result-unable-to-jump-to-row-1/#findComment-42828 Share on other sites More sharing options...
kenrbnsn Posted June 7, 2006 Share Posted June 7, 2006 Don't use the mysql_result() function, use mysql_fetch_assoc() instead:[code]<?php$query="SELECT * FROM news ORDER BY datum DESC LIMIT 1,1";$result=mysql_query($query);$num=mysql_numrows($result);$rw = mysql_fetch_assoc($result);$author2=$rw['author'];$text2=$rw['text'];$datum2=$rw['Datum'];$readmore2=$rw['readmore'];$image2=$rw['mage'];$title2=$rw['title'];$summary2=$rw['summary'];?>[/code]Ken Link to comment https://forums.phpfreaks.com/topic/11418-warning-mysql_result-unable-to-jump-to-row-1/#findComment-42831 Share on other sites More sharing options...
markspec87 Posted June 7, 2006 Author Share Posted June 7, 2006 ah thanks mate works a treat.Your a life Saver :) Link to comment https://forums.phpfreaks.com/topic/11418-warning-mysql_result-unable-to-jump-to-row-1/#findComment-42837 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.