romba Posted March 6, 2007 Share Posted March 6, 2007 Hi, I need some help with database queries and PHP script: Let's think there are 2 tables with those fields: table content - fields id, name, enabled (0 or 1) table links - fields livelink, relatedlink Related link contains the content's id and looks like this: index.php?user=me&id=22 What I need is to print all the content names with the livelinks which are enabled: <a href="livelink">Content name</a> I heard the best is to store all the id from the "relatedlink string" into an array with the livelinks and then loop it.... Is here anybody who knows how to make it? The links table can be huge and storing all the id's from there looks to wasty for me. I was thinking about storing the id's from the content table at first. But please be aware, that there can be problem selecting the related links - i.e. "select .... where xxxxxxxid=11" can select even xxxxxid=111 or xxxxx115 Thanks for any advice! Link to comment https://forums.phpfreaks.com/topic/41505-q-for-a-guru-php-and-mysql-vs-1-query-in-mssql/ Share on other sites More sharing options...
boo_lolly Posted March 6, 2007 Share Posted March 6, 2007 SELECT ..... WHERE xxxxxxxid = $var * Link to comment https://forums.phpfreaks.com/topic/41505-q-for-a-guru-php-and-mysql-vs-1-query-in-mssql/#findComment-201063 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.