paulnaj;10923090 wrote:The thing is, why are you testing the same thing 24 times?. In fact why are you testing to see if $fname is set. Surely, by that time every one of those variables will have been set, even if it's to NULL (edit: mysql NULL value).
I'm not 100% on this but if you return a row, you dont get a null. More to the point if mysql_fetch_array returns false, the while statement doesnt even process once. And thus his current error when the user isnt found.
He should be doing an if statement instead of a while, since he only wants one record and only one should be returned.
Now off the top of my head this is what he should have done.
if ($row = mysql_fetch_array($query)) {
// set vars to values returned
}
else {
// set vars to values to null
}