Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6085599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:39:24+00:00 2026-05-23T11:39:24+00:00

Im trying to put together a script that allows me to display links dynamically

  • 0

Im trying to put together a script that allows me to display links dynamically on my site.

I have 2 tables. The first one, domains can have two values per row. These being, domId and domain. The next table, links can contain a few values per row, the ones im working with here are domId(matches the domId of the domains table) desc and `link’.

Here is my query so far:

$linkQuery2 = 'SELECT `link`,`desc`,`domId` 
                 FROM `links` 
                WHERE `catId`="'.$pageCat.'" 
                   && (`modId`="1" || modId="'.$pageModel.'") 
             ORDER BY `domainId` ASC 
                LIMIT ' . $from . ', ' . $max_results2;    

Here is the code that im using to display the info i need:

$linkLoop2 = '';
$linkAd = $row['link'];
$linkDesc = stripslashes($row['desc']);
$linkDomain = stripslashes($row['id']);
$linkLoop = '<ul class="bymodel-dllinks">';
$linkLoop2 .= '<li><a href="'.$linkAd.'" target="_tab">'.$linkDesc.' '.$linkDomain.'</a></li>';
$linkLoop3 = '</ul>';

What I am trying to do is find a way so that when $linkDomain is echo’d it will display the text i have stored in the domain field on the domains table. Currently when $linkDomain is echo’d, it will display 303, which is the domId of the site i will be linking to.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:39:24+00:00Added an answer on May 23, 2026 at 11:39 am

    Use Join to select domain name from domainstable :

    $linkQuery2 = 'SELECT l.link,l.desc,l.domId,d.domain
                 FROM links l LEFT JOIN domains d ON d.domid = l.domid
                WHERE l.catId="'.$pageCat.'" 
                   && (l.modId="1" || l.modId="'.$pageModel.'") 
             ORDER BY l.domainId ASC 
                LIMIT ' . $from . ', ' . $max_results2;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to put together a query that will display one specific record
I've been trying to put together a script which allows a user to select,
I have a php script that I've put together from examples on the internet.
I trying to put together an Android app that will take a picture and
I'm trying to put together a simple RSS widget (for my wordpress blog) that
I'm trying to put together a contract-first web application using Spring-WS. I want to
I put together a simple script that pulls the product name, category name and
If I have output from two sources that I want to put together on
i'm trying to put together some Javascript form validation to check that all fields
I am trying to put together some accessibility examples for work. One of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.