This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > June 2006 > Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 7





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 7
jasonc

2006-06-01, 7:50 am

i am getting the error

Warning: mysql_result(): Unable to jump to row 0 on mysql result index 7

please can smoeone tell me where i might be going wrong?

thanks

<?
include("dbconfig.php");

//get reg code
$findstring = trim($_GET[s]);
if ($findstring != "") {

//find reg code in memberslist
$res = mysql_query("SELECT code FROM users WHERE code='$findstring' LIMIT 1");

if (mysql_num_rows($res) == 1) {
$res = mysql_query("UPDATE users SET code = 'done', password = 'catanddog' WHERE code='$findstring' LIMIT 1");
//upto here all is ok.

$res = mysql_query( "SELECT email FROM users WHERE code='$findstring' LIMIT 1" ) or die ( mysql_error() );
// the line above is almost the same as the request near the top of this code, eccept that it now looks for the email field not the code field.

$email = mysql_result( $res, 0 ) or die( mysql_error() );
echo('a.'.$email.'.a');
$res = mysql_query("INSERT INTO anothertable (email, field1, field2) VALUES ('$email', '', '')");
?>
<p>Thank you for completing you registration process.</p>
<?
} else {
?>
<p>Sorry but this is an illegal action.</p>
<?
}

}
mysql_close;
?>


and this is my database entry.



CREATE TABLE `users` (
`code` varchar(32) NOT NULL default '',
`email` varchar(40) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `users`
--

INSERT INTO `users` VALUES ('123', 'someone@domain.com');
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews