Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] SQL Error - Bug?

SQL Error - Bug? 05 Nov 2012 21:27 #5018

  • jcbenton
  • jcbenton's Avatar
  • Offline
  • Premium Member
  • Posts: 125
  • Thank you received: 9
  • Karma: 3
I came across this. I added the user GID field to a view form. Note the Unknown column.

Unknown column '_created_by_.gid' in 'field list' SQL=SELECT a.id,a.admin_notes,a.asset_name,a.created_by,a.creation_date,a.encoder,a.expires,a.key_file,a.mac_address,a.modification_date,a.modified_by,a.product,_created_by_.name AS `_created_by_name`,_created_by_.lastvisitDate AS `_created_by_lastvisitDate`,_created_by_.email AS `_created_by_email`,_created_by_.usertype AS `_created_by_usertype`,_created_by_.gid AS `_created_by_gid`,_created_by_.registerDate AS `_created_by_registerDate`,_product_.name AS `_product_name`,_encoder_.name AS `_encoder_name`,_modified_by_.name AS `_modified_by_name` FROM mbs_skm_licenses AS a LEFT JOIN `mbs_users` AS _created_by_ ON _created_by_.id = a.created_by LEFT JOIN `mbs_skm_products` AS _product_ ON _product_.id = a.product LEFT JOIN `mbs_skm_encoders` AS _encoder_ ON _encoder_.id = a.encoder LEFT JOIN `mbs_users` AS _modified_by_ ON _modified_by_.id = a.modified_by WHERE a.id = 1
--
Jerry Benton
Last Edit: 05 Nov 2012 21:28 by jcbenton.
The administrator has disabled public write access.

Re: SQL Error - Bug? 15 Nov 2012 07:52 #5369

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Hi @jcbenton,

It looks like you're creating a table that in large part recreates many fields ported from the users' table.

I don't believe you can do this in this way. I believe the solution would be to drop all of the user-related fields except for their PK (_created_by_.id) then, in your layouts, call all of the related user data you wish to display.

If your goal is to be creating users and adding additional user information to the core user data (extending the core) then I would advise creating a user profile plugin. Joomla has one built in called profile. You can update this to suit your needs. There is some good info here on this: www.inmotionhosting.com/support/edu/joomla-25/user-profile

Hope this helps!

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

Re: SQL Error - Bug? 15 Nov 2012 09:37 #5372

  • jcbenton
  • jcbenton's Avatar
  • Offline
  • Premium Member
  • Posts: 125
  • Thank you received: 9
  • Karma: 3
Uh no....

One field (created_by) is a foreign key to the the user table. In a fly view I can drop in user name, email, etc. When I dropped in GID, it failed.
--
Jerry Benton
The administrator has disabled public write access.

Re: SQL Error - Bug? 15 Nov 2012 14:14 #5382

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Sorry @jcbenton, read this very quickly before I left today... It's just that you said you added it to a view form in your post.

Have you tried locally?

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

Re: SQL Error - Bug? 21 Nov 2012 09:32 #5547

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
#__users.gid = Joomla 1.5
DO NOT USE IT ANYMORE

My virtual user table should avoid this one.
Sorry.

Moved in Opened Tickets.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: BTB300

Re: SQL Error - Bug? 09 Dec 2012 08:07 #5942

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Had this problem today thought it was a filter...
Thanks for the heads up :)
The administrator has disabled public write access.
Time to create page: 0.066 seconds

Get Started