Forum Moderators: coopster
I'm having two problems that I can't find the answers to, I have looked all around the community and in the manual but it has me beat.
1. From this code...
(line 10) $result = mysql_query ("SELECT password,email FROM table WHERE username = '$user' ");
(line 11) $myrow = mysql_fetch_array($result);
I get this error...
Warning: Supplied argument is not a valid MySQL result resource in [host details]/lostpassword.php3 on line 11
2. This code will not update my table
$sql = "UPDATE table SET user='$username',password='$password' WHERE id=$id";
I hope I have given you enough info.
Thanks in advance for any help.
$query = "SELECT password,email FROM table WHERE username = '$user' ";
$result= mysql_query($query) or
die ("your error message") ;
$myrow = mysql_fetch_array($result);
If that doesn't work it's possible (not sure) that you need to use variables other then "password" or "table" they could be confusing the system somewhere.
CODE
------------------------
// Set the variable $sql_select with a SQL query
$sql_select = "SELECT password,email FROM table WHERE username = '".$user."'";
// Execute the variable $sql_select and save it in the $result variable
$result = mysql_query ($sql_select);
// Grab results and drop into array
$myrow = mysql_fetch_array($result);
-----------------------
End CODE
Let me know if this works.
sorry... same error appears when I use that select code.
no joy... but please keep trying, I really appreciate you taking the time to help me :)
Is there anything I can send you that may help ?
this works, I think I had the field names the wrong way round :)
Thanks for all your help.