Posts: 1,832
Location: Somewhere else entirely
|
PHP Code:
if ($result = $hash ){
^ This is part of your problem.
For a start, you must use == (equality test) instead of = (assignment) when comparing things, and also $result is not a string, it is a fragment of database table. (In this case the fragment probably only contains one string, but it is still a database result). In this situation, I would simply say:
PHP Code:
$count = mysql_num_rows($result);
if($count > 0) {
echo "Hash matched";
}else {
echo "No match.";
}
mysql_num_rows($result) counts the rows in that table fragment I was on about. If the hash was correct, there will e one row, if it didn't there will be 0 rows. There are other mysql functions such as mysql_result() and mysql_fetch_array that retrieve the database contents themselves so you can use them as strings or numbers, but you don't need them here.
Other problems include the fact that you put three queries into strings, but only actually execute one of them with mysql_query(). You must do this for all of them or else your SQL commands just sit there in the string doing nothing.
I can't see what you do with the variable $encoded_email if anything.
There's a return statement at the end - what is this meant to do? Where are you returning to/from? This is usually used when returning from functions, and you don't define any in your scripts.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';
Please login or register to view this content. Registration is FREE (aka MSN handwriting for forums)
Last edited by 0beron; 09-16-2005 at 02:14 PM..
|