I’m using the following query to join two tables, extracting a number of values (e.g page title) and displaying an article from the field AI.Article…
$Zext = mysql_fetch_assoc(mysql_query("SELECT GZ.N, GZ.URL, GZ.Title, GZ.Subtitle,
GZ.Parent, GZ.Live, AI.URL, AI.Article
FROM gz_topics GZ
LEFT JOIN gz_articles_topics_intro AI ON AI.URL = GZ.URL
WHERE GZ.URL LIKE '$MyURL' AND GZ.Live = 1"));
It works fined. But when I put my articles in three separate tables, I can’t display the article…
$Zext = mysql_fetch_assoc(mysql_query("SELECT GZ.N, GZ.URL, GZ.Title, GZ.Subtitle,
GZ.Parent, GZ.Live, Art.URL, Art.Article, AI.URL, AI.Article, AN.URL, AN.Article
FROM gz_topics GZ
LEFT JOIN gz_articles_topics Art ON Art.URL = GZ.URL
LEFT JOIN gz_articles_topics_intro AI ON AI.URL = GZ.URL
LEFT JOIN gz_articles_topics_names AN ON AN.URL = GZ.URL
WHERE GZ.URL LIKE 'Birds' AND GZ.Live = 1"));
I pasted the query into SQL, and it works fine; it displays the article I’m trying to display on my page. So why can’t I display the article on my page?
This is the code I’m using to display database values:
$Article = $Zext['Article'];
echo $Article;
Thanks.