cosmicsea Posted December 31, 2010 Share Posted December 31, 2010 I am using a script I found online tow work with sphinx fulltext search engine and it works fine but when I try to select multiple tables i get this error mysql query failed: Column 'link_id' in where clause is ambiguous $CONF['mysql_query'] = ' SELECT links.link_id AS id, links.title AS title, links.url AS url, links.fulltxt AS body, media.link_id, media.media_id AS m_id, media.title AS title, media.thumb_link AS t_link FROM links, media WHERE link_id IN ($ids) '; I am just trying to be able to fetch results from both tables and this is the default sql for the script but i tried to make it select 2 tables instead of one. I need to display thumbnails for every specific link. Any idea what I should change this query to? Link to comment https://forums.phpfreaks.com/topic/223083-mysql-query-failed-column-link_id-in-where-clause-is-ambiguous/ Share on other sites More sharing options...
Maq Posted December 31, 2010 Share Posted December 31, 2010 WHERE link_id IN ($ids) 'link_id' exists in multiple tables, you must specify which one you want to use. Just like in your SELECT clause. Link to comment https://forums.phpfreaks.com/topic/223083-mysql-query-failed-column-link_id-in-where-clause-is-ambiguous/#findComment-1153367 Share on other sites More sharing options...
cosmicsea Posted December 31, 2010 Author Share Posted December 31, 2010 even when i do that, It still says the same thing. I am trying to make 2 queries into one and cannot get it to work. Link to comment https://forums.phpfreaks.com/topic/223083-mysql-query-failed-column-link_id-in-where-clause-is-ambiguous/#findComment-1153372 Share on other sites More sharing options...
Maq Posted December 31, 2010 Share Posted December 31, 2010 even when i do that, It still says the same thing. I am trying to make 2 queries into one and cannot get it to work. Show me the current query and the exact error message. Link to comment https://forums.phpfreaks.com/topic/223083-mysql-query-failed-column-link_id-in-where-clause-is-ambiguous/#findComment-1153384 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.