we could do with knowing what line 49 is in userdetails.php ... also the query that is associated with line 49 if you find it make sure u add
Code:
sqlerr(__FILE__,__LINE__);
on the end of the query .. this will give you a much more detailed explaination of the error if its something to do with teh construction of the query (which it most likely is)