Jump to content


Photo

Warning: mysql_result(): Unable to jump to row 1...


  • Please log in to reply
4 replies to this topic

#1 markspec87

markspec87
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 07 June 2006 - 02:58 PM

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.)


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 07 June 2006 - 03:07 PM

$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");
}
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 markspec87

markspec87
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 07 June 2006 - 03:23 PM

[!--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]

:(

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 07 June 2006 - 03:31 PM

Don't use the mysql_result() function, use mysql_fetch_assoc() instead:
<?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'];
?>
Ken

#5 markspec87

markspec87
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 07 June 2006 - 03:42 PM

ah thanks mate works a treat.

Your a life Saver :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users