Your MySQL-Table (called "tbl_users") does not have a column called "user_id". If you send the MySQL database to me, or send me an installation script for the MySQL database, I could tell you which is the correct name for the column and fix your script. But as far as it currently looks, your fault is on line 215, where you try to filter the SELECT-clause by the "user_id"-property, which does not seem to exist on the "tbl_users"-table.