Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
683 views
in Technique[技术] by (71.8m points)

php - MySQL- Unable to jump to row 0 on MySQL result index

I have got an old site that has recently been displaying an error which is weird as its been untouched for some time. I get the following:

Unable to jump to row 0 on MySQL result index 8

What is the cause of this and how should I fix it?

It is a PHP/MySQL site.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If I remember correctly, this error typically stems from a code segment like the following:

// You probably have some code similar to this
$var = mysql_result( $result, 0, 'column_name');

Where either the query fails or the column doesn't exist. Check that $result is a valid MySQL resource to make sure that the SQL is valid, then make sure you're actually getting results from the database before trying to call mysql_result.

Or, better yet, using mysql_fetch_array instead of manually fetching every column value (if you have multiple columns returned from the query).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...