Unknown column error when it really does exist

I don’t understand why I am getting the error, “Unknown column c.dateAdded in field list”. This field really does exist and I spelled it correctly.

Thoughts?

Thanks!

SELECT 
	c.cID, 
	c.dateAdded, 
	c.tID, 
	c.action,
	c.status,
	c.length,
	c.dateStarted,
	c.dateEnded,
	t.title 
FROM compliance c, testimonies t 
WHERE
	c.adminID = 717
	and c.tID = t.tID

Is it actually part of the testimonies table and should be t.dateAdded?

The testimonies table also has a dateAdded column, but to answer your question, no. I’m trying to get the dateAdded from the compliance table for this example.

please run this and show us the full results –

SHOW CREATE TABLE compliance

CREATE TABLE compliance (
cID int(11) unsigned NOT NULL AUTO_INCREMENT,
tID int(5) unsigned NOT NULL DEFAULT ‘0’,
authorID int(5) unsigned NOT NULL DEFAULT ‘0’,
adminID int(5) unsigned DEFAULT NULL,
action varchar(10) CHARACTER SET latin1 DEFAULT NULL,
status varchar(10) CHARACTER SET latin1 DEFAULT NULL,
length int(5) unsigned NOT NULL DEFAULT ‘0’,
dateStarted datetime DEFAULT NULL,
dateEnded datetime DEFAULT NULL,
PRIMARY KEY (cID)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8

I admit I could use a new pair of eyeglasses, but I’m not seeing a dateAdded field in that.

4 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.