Warning: mysql_result() [function.mysql-result]:
Posted: Tue Aug 04, 2009 4:43 am
Hi all,
I am a new to PHP i've created a login pages.I'm trying to execute the change password code it gives me the below warning message, and the changed password doesn't reflect in the database.
-----Warning: mysql_result() [function.mysql-result]: Unable to jump to row 7 on MySQL result index 4 in C:\wamp\www\new\check.php on line 13----
and the code is
Please anyone can help me to fix this problem.
Thanks in advance,
Regards,
Swathi.
I am a new to PHP i've created a login pages.I'm trying to execute the change password code it gives me the below warning message, and the changed password doesn't reflect in the database.
-----Warning: mysql_result() [function.mysql-result]: Unable to jump to row 7 on MySQL result index 4 in C:\wamp\www\new\check.php on line 13----
and the code is
Code: Select all
<?php
session_start();
include "dbconnection.php"; //database=sampledb,table=users
$result = mysql_query("select password from users where username='$_POST[username]' and userID='$_POST[userID]'");
if(!$result)
{
echo "oops! The Username you entered does not exist";
}
else
if($_POST['password']!= mysql_result($result,0))
{
echo "You entered an incorrect password";
}
else if($_POST['newpassword']!=$_POST['confirmnewpasssword'])
{
echo "The new password and confirm new password fields must be the same";
}
else
$sql=mysql_query("UPDATE users SET password='$_POST[newpassword]' where username='$_POST[username]'");
if($sql)
{
echo "Congratulations You have successfully changed your password";
}
?>
Please anyone can help me to fix this problem.
Thanks in advance,
Regards,
Swathi.