Sinisakrisan (Talk | contribs) (→Fixing the Error) |
Sinisakrisan (Talk | contribs) |
||
Line 1: | Line 1: | ||
+ | {{alert|This article is work in progress and is not completed yet|alert}} | ||
==Overview== | ==Overview== | ||
This is the type of error you will often see when database table upon request have been made do not have all needed columns to complete the call. <br/> | This is the type of error you will often see when database table upon request have been made do not have all needed columns to complete the call. <br/> |
Revision as of 01:47, 28 May 2013
Contents
Overview
This is the type of error you will often see when database table upon request have been made do not have all needed columns to complete the call.
Error might be scary but, because SQL syntax is written in pure English, in almost every case it gives you the exact place where you should start troubleshooting.
Most often cause of the error is crippled database due the JomSocial upgrade from version older then previous active version. To find out how to upgrade properly, please visit this link
If however you didn't followed the recommendations from the link above, do not panic. For a start, lets examine and explain the error
Error Example & Explanation
The usual output of error would look something like this:
- Error 500, database function failed with error number 1054
Unknown column 'a.friends' in 'field list' SQL=SELECT a.`userid` as _userid , a.`status` as _status , a.`points` as _points, a.`posted_on` as _posted_on, a.`avatar` as _avatar , a.`thumb` as _thumb , a.`invite` as _invite, a.`params` as _cparams, a.`view` as _view, a.`friends` as _friends, a.`groups` as _groups, a.`events` as _events, a.`friendcount` as _friendcount, a.`alias` as _alias, a.`profile_id` as _profile_id, a.`storage` as _storage, a.`watermark_hash` as _watermark_hash, a.`search_email` as _search_email, s.`userid` as _isonline, u.* FROM `prefix_community_users` as a LEFT JOIN `prefix_users` u ON u.`id`=a.`userid` LEFT OUTER JOIN `prefix_session` s ON s.`userid`=a.`userid` AND s.`client_id` !='1' WHERE a.`userid`='62'
This might look like there is a lot going on, but actually, it is just a missing column and error is clearly pointing to it
In very begining of error, it says Unknown column 'a.friends'
The next point of interest is FROM statement which will tell as from what table this column is missing. In our case this is FROM `prefix_community_users`
Translated to language common to average web admin, this means that column friends is missing from table prefix_community_users
Now we know exactly where the problem is, lets see how to fix it
Fixing the Error
Requirements
In order to fix the error, you will need following
- Localhost Server. See http://docs.joomla.org/J2.5:Use_Joomla!_on_your_own_computer
- Clean instance of exact Joomla version from your site running on localhost
- Clean instance of exact JomSocial version running at Joomla on localhost
- Make sure that localhost environment runs smooth, without errors, and without third party extensions installed
- Code editor or IDE of your choice. For simple usage we recommend Notepad++
Step 1 Getting the Table Structure
Knowing the table structure