Skip to Content Skip to Menu

[SOLVED] moscomprofiler::store failed - added column

  • tick1970
  • tick1970
  • OFFLINE
  • Posts: 21
  • Thanks: 0
  • Karma: 0
12 years 3 months ago - 12 years 2 months ago #191934 by tick1970
All has been fine, but I added a new column to my jos_users called jackpot which i populate with a symbol if a user has paid to enter a jackpot contest. That way i can keep track of who has paid and who hasnt. But when i try to edit any users data in the CB USers list I get the following error.

moscomprofiler::store failed: Unknown column 'jackpot' in 'field list' SQL=UPDATE `jos_comprofiler` SET `user_id`=78.....

It still saves the data and it is changed so in some ways it isnt causing any problems except that it isnt ideal that it brings up errors, and I just dont want it to cause any errors somewhere else in the functionality of the CB database.

Any suggestions
Last edit: 12 years 2 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • rspack
  • rspack
  • OFFLINE
  • Posts: 49
  • Thanks: 5
  • Karma: 6
12 years 3 months ago #191943 by rspack
I am making an assumption the symbol you enter is an ASCII symbol such as !@#$%^&*()_+ and not an image?

If so, then you might want to do it this way:

1. Delete the column you made in jos_users. This will bring you back to the default database before you added column.
2. Create a new tab in CB tab management and title it Jackpot. Set the Access level to Admin (SuperUser).
3. Next, create a new text field and label it Jackpot. Then add this field to the new Jackpot tab you created.

This new tab will not appear to the users when viewing their profile, but will appear to the Admin on the backend when viewing a user's profile when in edit user mode. Now you can open up a user, click on the Jackpot tab and make changes to this field from here. If you wish the tab and field to appear on user's profiles and allw them to view, change the tab from Admin(superUser) to Registered user and set the field to read only.

Hope this helps.

Please Log in or Create an account to join the conversation.

  • tick1970
  • tick1970
  • OFFLINE
  • Posts: 21
  • Thanks: 0
  • Karma: 0
12 years 2 months ago #191960 by tick1970
that soundspretty good, but ill describe ow it is used and see if that would still work.

The $ is what i would pt in and in the backend it is for my uses but when i do the points tally, an oscar pool contest, on the night i have a live standings page with user name and tally ppoints from a pools database. Thing is all people who enter its free, but i do a seperate jackpot for those that paid so on the standings i woould have a Username column, their points column and a column showing if they entered (ie the dollar sign woukld be behind those have paid) so ive got the pools view php gettig that info from the field ive created originally,so if i can do the same with the field from CB, then that would work, do you think it would? i Can show the code i have for the view php

Please Log in or Create an account to join the conversation.

  • tick1970
  • tick1970
  • OFFLINE
  • Posts: 21
  • Thanks: 0
  • Karma: 0
12 years 2 months ago #191964 by tick1970
Here is the rough way i want it to appear on the Live Standings page

Jim 155
Bob 145
Sam 142 $
Bill 140 $
Nancy 138

and here is what i did first for my original code, which was done by a freelancer

1. Add the field(jackpot eg) to the users table (I'm assuming you will manually add $ against the names)

2. components\com_pools\models\tally.php (change as follows)

$query =
"SELECT u.name as user, u.jackpot, SUM(tp2.points) AS user_points " .
"FROM #__tc_pools as tp, " .
" #__tc_categories as tc, " .
" #__tc_selections as ts, " .
" #__tc_points tp2, " .
" #__users u " .
"WHERE tp.id = tc.pool_id " .
"AND tc.id = tp2.category_id " .
"AND tc.id = ts.category_id " .
"AND tc.winner_nomination_id = ts.nomination_id " .
"AND ts.nomination_type = tp2.nomination_type " .
"AND ts.username = u.username " .
"GROUP BY u.name, u.jackpot " .
"ORDER BY SUM(tp2.points) DESC";

3. change components\com_pools\views\tally\tmpl\default.php

<tr><th>User</th><th>Points</th><th>Jackpot</th></tr>



<tr><td><?php echo $row->user ?></td><td><?php echo $row->user_points ?></td><td><?php echo $row->jackpot?></td></tr>

hope that gives enough info as to what im trying to achieve, if your solution can suit this would be great if not i can live with the error until after SUnday night

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 68607
  • Thanks: 9108
  • Karma: 1434
12 years 2 months ago #191993 by krileon
Why are you manually altering the database tables? Please don't tamper with the tables. To add a field simple add it through CB > Field Management and it'll safely add the table column to _comprofiler. Never alter _users, ever. In your query just do a join of _comprofiler and pull it from there.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • tick1970
  • tick1970
  • OFFLINE
  • Posts: 21
  • Thanks: 0
  • Karma: 0
12 years 2 months ago #192008 by tick1970
ill put the user table back to the original status and hope my programemr can do this for me

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum

Facebook Twitter LinkedIn