Bug #29005 Warning: mysql_result: Unable to jump to row......
Submitted: 9 Jun 2007 8:38 Modified: 9 Jul 2007 20:38
Reporter: Errol Jacoby Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:MySQL 4.0.26 & PHP 5.0.4 OS:Any
Assigned to: CPU Architecture:Any

[9 Jun 2007 8:38] Errol Jacoby
Description:
I am not sure if this is a MySQL or a PHP bug. It has come from nowhere, affecting previously functioning code:

$query2 = "SELECT * FROM news WHERE newsid='$newsid';";
$result2 = mysql_query($query2,$databas_link);

	$firstname = mysql_result($result2,0,"firstname");
	$lastname = mysql_result($result2,0,"lastname");
	$heading = mysql_result($result2,0,"heading");
	$mess = mysql_result($result2,0,"mess");

resulting in this warning for each of the for lines above:

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 6 in /usr/home/web/wse44148/news/edit_message.php on line 38

The SAME data is read and executed the first time the page is loaded, to fill the fields of a form for editing forum and news messages. ONLY when the "SAVE" button is pressed:

<input type="hidden" name="newsid" value="<?php echo "$newsid"; ?>">
<input type="submit" name="Edit" value="Spara" /></td>

do these warnings appear. Any changes made to the messages are saved though, so it appears as though the form cannot "refresh" itself after the "save" button is pressed. It has nothing to do with the code for saving - I can remove that completely and it still appears.

As I said earlier, this "old" code functioned previously without any warnings. Now, if one does a search for the fault on e.g. Google, 1) there are SO many hits with sites with exactly the same problem and 2) there does not seem to be a solution anywhere, not even on your site.

I would also like to mention that the PHP pages for editing the forum and the news are two seperate pages and although they basicly have the same code, they are executed with different variables and tables. The same column data extraction rows generate the same warning messages though. 

How to repeat:
Don't have to - just do a search for "Warning: mysql_result() [function.mysql-result]: Unable" on Google. The results will amaze you! There are one or two others on your forum that have posted this warning, but no solution as yet.

Suggested fix:
No idea at all!
[9 Jun 2007 20:38] Sveta Smirnova
Thank you for the report.

But version 4.0.26 is quite old. Please upgrade to current version 4.0.30, try with it and if you can repeat provide output of SHOW CREATE TABLE news and output of query "SELECT * FROM news WHERE newsid='$newsid';" issued in the mysql command line client where you replace $newsid with value for which you get error in PHP application.
[9 Jul 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[7 Aug 2009 16:32] ross gates
Has anyone discovered a fix for this error? It is quite literally driving me insane at this point...I cannot fix it.
[24 Mar 2010 18:54] James S
+-------------------------+-------------------+
| Variable_name           | Value             |
+-------------------------+-------------------+
| protocol_version        | 10                |
| version                 | 5.0.51a-24+lenny3 |
| version_comment         | (Debian)          |
| version_compile_machine | i486              |
| version_compile_os      | debian-linux-gnu  |
+-------------------------+-------------------+

I'm on what is the newest version apt-get will retrieve for me and I am getting this error.

The line of code that is erroring is

$path = mysql_result(mysql_query("select fpointer from flist where `uuid` = '$uuid' limit 1;"),0,0);

the table flist exists and the fields fpointer and uuid exist