Page 1 of 1

DB function failed with error number 1054

Posted: Sun Nov 20, 2005 10:56 pm
by coneli
After installing Joomla and trying to administrate i recieve this message when clicking on the "content item manager"!

DB function failed with error number 1054
Unknown column 'c.access' in 'on clause' SQL=SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author FROM jos_content AS c, jos_categories AS cc, jos_sections AS s LEFT JOIN jos_groups AS g ON g.id = c.access LEFT JOIN jos_users AS u ON u.id = c.checked_out LEFT JOIN jos_users AS v ON v.id = c.created_by LEFT JOIN jos_content_frontpage AS f ON f.content_id = c.id WHERE c.state >= 0 AND c.catid = cc.id AND cc.section = s.id AND s.scope = 'content' ORDER BY s.title, c.catid, cc.ordering, cc.title, c.ordering LIMIT 0, 10

Please help

???

Re: DB function failed with error number 1054

Posted: Fri Jan 13, 2006 5:49 pm
by mdl_kid
I am getting a similar error. When i first installed the program i could log in and do everything fine. I was changing details in parts of the program, I was working with the configuration file, and i made some minor changes. I turn on SEF hit save and it automatically loged me out. I couldn't log back in so i thought maybe the SEF wasn't working, so i opened up the config file in dreamweaver to change it back to 0. It did not fix the problem.

Any ideas?

Re: DB function failed with error number 1054

Posted: Fri Jan 13, 2006 6:46 pm
by Tonie
Are you both using Mysql 5? Mysql 5 isn't fully supported yet on Joomla, though it is getting better and almost there. For the moment, it will be easier to use Mysql 4.1.x

Re: DB function failed with error number 1054

Posted: Fri Jan 13, 2006 7:54 pm
by mdl_kid
I fixed my problem, i was messing with the code and i didnt relize i didn't set everything back  to the original and the database code was wrong.

Re: DB function failed with error number 1054

Posted: Wed Jan 18, 2006 6:52 pm
by jmacdoug2005
I am having the same problem. I am running MySql 4.1.10 and I come up with this error on my web page when someone clcks to register (anything having to do with registrations)

DB function failed with error number 1054
Unknown column 'session_id' in 'where clause' SQL=select * from mos_events_registrations where session_id=1 and cancel_date='0'and userid=-1

Any insight?

Re: DB function failed with error number 1054

Posted: Thu Jan 19, 2006 5:51 am
by mdl_kid
I got the unknown session id when my session save path was not set to a valid location. I had to use the session_save_path(mypath) in my configuration file to point to a location that sessions could be saved and read. It sounds like a session problem to me.

Martin

Re: DB function failed with error number 1054

Posted: Thu Jan 19, 2006 2:55 pm
by jmacdoug2005
where would i actually make this change? in the config file in joomla? what exactly is the string to add?

thanks for your input.

jeff

Re: DB function failed with error number 1054

Posted: Thu Jan 19, 2006 3:10 pm
by jmacdoug2005
I actually just looked up the 1054 code on mysql.com and came up with this interpretation..

#

Error: 1054 SQLSTATE: 42S22 (ER_BAD_FIELD_ERROR)

Message: Unknown column '%s' in '%s'

I have no idea what to do. This is a bit frustrating.  errrrrrrr!

I appreciate all the help anyone gives!!

Jeff

Re: DB function failed with error number 1054

Posted: Thu Jan 19, 2006 4:18 pm
by mdl_kid
if i remember correctly the field was bad because it didn't have the session set correctly, but then again it could have been when i tried changing the SQL statement also. If you did not change any of the code in Joomla then i guess it would be the session problem.

BUt the nyou would have had trouble installing joomla also. I had to put the code: "session_save_path(cgi-bin/tmp);" in both a file in the installation package and the "configuration.php" for joomla's main configuration after install. I don't remember what file i put the code into for the install but it should be easy to find if you look at the includes in the index.php of the install directory.

If this was not the problem, i don't know what to tell you other than try downloading the newest version and doing the install again.

Martin

Re: DB function failed with error number 1054

Posted: Thu Jan 19, 2006 4:40 pm
by jmacdoug2005
If I do a fresh install of joomla will all of my coms, mods, and bot still exist? I will do a backup anyway but is this the case?

Re: DB function failed with error number 1054

Posted: Thu Jan 19, 2006 5:19 pm
by mdl_kid
Well that depends on whether you delete your entire website before you fresh install. You will have to erase your mysql database if you want to reinstall with the same prefix (I would suggest this so you don't have double the amount of tables for no reason). If you back up everything there will be no problems.

Re: DB function failed with error number 1054

Posted: Thu Jan 19, 2006 6:28 pm
by jmacdoug2005
OK, I actually just created a subfolder and reinstalled joomla 1.0.7. Install went flawless. As soon as I installed the Events com it gave me the same crap! Now get this, I uninstalled the Events com and just installed the Events Sessions Com and that works like a champ!! I then went and applied the Event Sessions com to my main Joomla installation and that works fine as well. The Events com is just buggy at the moment and I don't have time so the Event Sessions com is just fine by itself for the time being.

Thanks alot for your helpful replies.

jeff

mod edit: please do not add signature manually, use your profile.

THE SOLUTION

Posted: Thu Sep 07, 2006 9:54 am
by theblase
Change this code in "admin.content.php"

From:

Code: Select all

$query = "SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author"
	. "\n FROM #__content AS c, #__categories AS cc, #__sections AS s"
	. "\n LEFT JOIN #__groups AS g ON g.id = c.access"
	. "\n LEFT JOIN #__users AS u ON u.id = c.checked_out"
	. "\n LEFT JOIN #__users AS v ON v.id = c.created_by"
	. "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = c.id"
	. ( count( $where ) ? "\nWHERE " . implode( ' AND ', $where ) : '' )
	. $order
	. "\n LIMIT $pageNav->limitstart,$pageNav->limit"
	;
To:

Code: Select all

$query = "SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author"
	. "\n FROM #__content AS c" //, #__categories AS cc, #__sections AS s"
	. "\n LEFT JOIN #__groups AS g ON g.id = c.access"
	. "\n LEFT JOIN #__users AS u ON u.id = c.checked_out"
	. "\n LEFT JOIN #__users AS v ON v.id = c.created_by"
	. "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = c.id"
	. "\n LEFT OUTER JOIN #__categories AS cc ON c.catid=cc.id"
	. "\n LEFT OUTER JOIN #__sections AS s ON cc.section=s.id"
	. ( count( $where ) ? "\nWHERE " . implode( ' AND ', $where ) : '' )
	. $order
	. "\n LIMIT $pageNav->limitstart,$pageNav->limit"
	;
This solution will help your life!  8)

THB

Re: DB function failed with error number 1054

Posted: Wed Aug 22, 2007 4:13 am
by ikez
wow, this is helpful. thanks theblase

Re: THE SOLUTION

Posted: Wed Nov 14, 2007 7:03 pm
by Immortal King
theblase wrote: Change this code in "admin.content.php"

From:

Code: Select all

$query = "SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author"
	. "\n FROM #__content AS c, #__categories AS cc, #__sections AS s"
	. "\n LEFT JOIN #__groups AS g ON g.id = c.access"
	. "\n LEFT JOIN #__users AS u ON u.id = c.checked_out"
	. "\n LEFT JOIN #__users AS v ON v.id = c.created_by"
	. "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = c.id"
	. ( count( $where ) ? "\nWHERE " . implode( ' AND ', $where ) : '' )
	. $order
	. "\n LIMIT $pageNav->limitstart,$pageNav->limit"
	;
To:

Code: Select all

$query = "SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author"
	. "\n FROM #__content AS c" //, #__categories AS cc, #__sections AS s"
	. "\n LEFT JOIN #__groups AS g ON g.id = c.access"
	. "\n LEFT JOIN #__users AS u ON u.id = c.checked_out"
	. "\n LEFT JOIN #__users AS v ON v.id = c.created_by"
	. "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = c.id"
	. "\n LEFT OUTER JOIN #__categories AS cc ON c.catid=cc.id"
	. "\n LEFT OUTER JOIN #__sections AS s ON cc.section=s.id"
	. ( count( $where ) ? "\nWHERE " . implode( ' AND ', $where ) : '' )
	. $order
	. "\n LIMIT $pageNav->limitstart,$pageNav->limit"
	;
This solution will help your life!  8)

THB
But my admin_content.php file has a different line: I have "\n FROM #__content AS c" instead of "\n FROM #__content AS c, #__categories AS cc, #__sections AS s" where all those fixes seem to focus.

Re: DB function failed with error number 1054

Posted: Thu Nov 15, 2007 8:57 am
by Tonie
Probably because this was for 1.0.8, and you are using 1.0.13?

Re: DB function failed with error number 1054

Posted: Sun Nov 18, 2007 2:47 am
by Immortal King
Yes I am. How do I fix my problem then?

Re: DB function failed with error number 1054

Posted: Fri Dec 14, 2007 5:33 pm
by AndyWhitelaw
I have the same problem as listed above but I am using 1.0.13 and my admin_content.php is different.
Anyone know what the replacement test for 1.0.13 is?

Thanks

Re: THE SOLUTION

Posted: Wed Dec 26, 2007 9:13 pm
by whataslacker
Where do we find admin.content.php?

theblase wrote: Change this code in "admin.content.php"

From:

Code: Select all

$query = "SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author"
	. "\n FROM #__content AS c, #__categories AS cc, #__sections AS s"
	. "\n LEFT JOIN #__groups AS g ON g.id = c.access"
	. "\n LEFT JOIN #__users AS u ON u.id = c.checked_out"
	. "\n LEFT JOIN #__users AS v ON v.id = c.created_by"
	. "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = c.id"
	. ( count( $where ) ? "\nWHERE " . implode( ' AND ', $where ) : '' )
	. $order
	. "\n LIMIT $pageNav->limitstart,$pageNav->limit"
	;
To:

Code: Select all

$query = "SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author"
	. "\n FROM #__content AS c" //, #__categories AS cc, #__sections AS s"
	. "\n LEFT JOIN #__groups AS g ON g.id = c.access"
	. "\n LEFT JOIN #__users AS u ON u.id = c.checked_out"
	. "\n LEFT JOIN #__users AS v ON v.id = c.created_by"
	. "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = c.id"
	. "\n LEFT OUTER JOIN #__categories AS cc ON c.catid=cc.id"
	. "\n LEFT OUTER JOIN #__sections AS s ON cc.section=s.id"
	. ( count( $where ) ? "\nWHERE " . implode( ' AND ', $where ) : '' )
	. $order
	. "\n LIMIT $pageNav->limitstart,$pageNav->limit"
	;
This solution will help your life!  8)

THB

Re: DB function failed with error number 1054

Posted: Sat Jan 05, 2008 11:05 pm
by whataslacker
Sorry but working on 1.0.11 and the code looks like this:

Code: Select all

	$query = "SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author"
	. "\n FROM #__content AS c"
	. "\n LEFT JOIN #__categories AS cc ON cc.id = c.catid"
	. "\n LEFT JOIN #__sections AS s ON s.id = c.sectionid"
	. "\n LEFT JOIN #__groups AS g ON g.id = c.access"
	. "\n LEFT JOIN #__users AS u ON u.id = c.checked_out"
	. "\n LEFT JOIN #__users AS v ON v.id = c.created_by"
	. "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = c.id"
	. ( count( $where ) ? "\n WHERE " . implode( ' AND ', $where ) : '' )
	. $order
	;
So this fix I keep getting pointed to does not work for the xdtratings error I keep getting
DB function failed with error number 1054
Since my server move us to mySQL5
So I still need help! PLEASE  :'(

Re: DB function failed with error number 1054

Posted: Wed Jan 09, 2008 4:16 am
by PavlovaPete
Hi all,

our ISP had a RAID controller failure :o recently and had to move the site files to a new server. We are slowly working our way through the reinstallation and reconfiguration. Mostly things are going OK. However we have an issue with com_events and com_phpmyadmin.

com_events is giving us the "DB function failed with error number 1054" message discussed in this thread. phpmyadmin is not working at all.

I'm not that keen to hack the core.

I'm currently asking our ISP when they upgraded php - I can see that we are now using php 5.2.5 - I wonder if this might be the cause of the problems?

If anyone can throw some light on this issue I'd be most appreciative.

Thanks

Cheers

Re: DB function failed with error number 1054

Posted: Thu Jan 10, 2008 3:25 am
by PavlovaPete
OK - so it wasn't php but a MySQL upgrade that caused the problem (at least for the events component)

I've posted the solution for the events component here - http://forum.joomla.org/index.php/topic ... msg1148924

Looks like you have to wrap the FROM clause in brackets e.g. FROM (#__events AS a, #__categories AS cc)

HTH

Cheers

Re: DB function failed with error number 1054

Posted: Mon Jan 14, 2008 2:45 am
by frodojrr
I am running Joomla 1.0.13, and just started getting this error for the first time today when I installed sh404SEF.  In the administrative panel, when I click on some of the items, like "View/Edit SEF Urls", I get the following error:
DB function failed with error number 1054
Unknown column 'rank' in 'order clause' SQL=SELECT * FROM jos_redirection WHERE `dateadd` = '0000-00-00' ORDER BY `oldurl`, `rank` ASC LIMIT 0,50
This thread started a while back.  Would any of the solutions proposed apply to my situation?

Re: DB function failed with error number 1054

Posted: Tue Feb 12, 2008 1:52 am
by deterius
Im having roughly the same issue-
every time I try to update a profile I get this error:

(Joomla! 1.0.12 Stable)

Code: Select all

DB function failed with error number 1054
Unknown column 'cb_internationalbusinessresearchprogramscontactper' in 'field list' SQL=UPDATE jos_comprofiler SET 
`user_id`='76',`approved`='1',`confirmed`='1',`address2`='Honolulu, HI 96822',`cb_studentexchangecoordinator`='Rikki 
Mitsunaga',`school_name`='University of Hawaii',`email2`='',`department`='Shidler College of 
Business',`website`='http://www.shidler.hawaii.edu/',`contact1`='Dr. Shirley 
Daniel',`email1`='[email protected]',`contact2`='',`title2`='',`title1`='Pacific Asian Management Institute 
Director',`country`='USA',`address`='2404 Maile Way, A303',`phone`='(808) 956-8041',`fax`='(808) 956-9685',`cb_extitle`='Test - 
Please Fill',`cb_exschool`='Chulalongkorn, National Taiwan University, Shanghai University of Finance and Economics',`cb_exemail`='Test - 
Please Fill',`cb_scholinfo`='',`cb_schoolupdates`='Test of a School update, please 
replace.',`cb_fafirstname`='',`cb_falastname`='',`cb_fatitle`='',`cb_fadesc`='',`cb_facountry`='',`cb_fatelephone`='',`cb_fafax`='',
`cb_faaddress`='',`cb_faschoolname`='',`cb_faemail`='',`cb_fainterest`='',`cb_facultyresearchcontact`='',
`cb_facultyresearchcontacttitle`='',`cb_facultyresearchcontactemail`='',`cb_internationalbusinessresearchprogramstitle`='',`cb_internationalbusinessresearchprogramswebsite`='',`cb_internationalbusinessresearchprogramscontactper`='',`cb_internationalbusinessresearchprogramsemailconta`='',`cb_internationalbusinessresearchstaffname`='',`cb_internationalbusinessresearchstafftitle`='',`cb_internationalbusinessresearchstaffemail`='',`firstname`='',`middlename`='',`lastname`='' WHERE id='76'
SQL =

UPDATE jos_comprofiler SET `user_id`='76',`approved`='1',`confirmed`='1',`address2`='Honolulu, HI 
96822',`cb_studentexchangecoordinator`='Rikki Mitsunaga',`sch