PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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----
<?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";
}
?>
hi
u can try this one..
$result = mysql_query(mysql_fetch_array("select password from users where username='$_POST[username]' and userID='$_POST[userID]'"));
select password from users where username='$_POST[username]' and userID='$_POST[userID]---error...
Because your args r null for that reason only its showing warning error......