SQL: Error in Query

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mohson
Forum Contributor
Posts: 372
Joined: Thu Dec 02, 2004 6:58 am
Location: London

SQL: Error in Query

Post by mohson »

I get the following error.

Error in query: Unknown table 'c' in field list

the table is called cpanel, previousy I've used the first letter in the tables name to recognise it but in this case its not accepting it?

Code: Select all

$query = 	"SELECT 
		 
c.person_id,c.salutation,c.firstname,c.surname,c.email,c.organisation,c.address,c.address1,
c.telephone,c.primarycontact,c.cpreg,c.cpint,c.org_id,o.org_id
	
FROM cpanel f LEFT JOIN organisations o 
ON o.org_id = c.org_id
ORDER BY name ASC ";
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

you table c is missing, you need to give c table name
mohson
Forum Contributor
Posts: 372
Joined: Thu Dec 02, 2004 6:58 am
Location: London

Apologies

Post by mohson »

Apologies I didnt notice the f My Mistake.
Post Reply