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 8530665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:18:04+00:00 2026-06-11T09:18:04+00:00

I am having trouble with URLs stored in my database not displaying properly. Here

  • 0

I am having trouble with URLs stored in my database not displaying properly. Here is my code:

    $sqlCommand = 
       "SELECT  rotator.title, rotator.imageURL, rotator.targetURL, rotator.caption  FROM rotator   
        WHERE ( ( rotator.visible = '1' )
        OR ( rotator.visible = '2' AND ( NOW() BETWEEN rotator.schedstart AND rotator.schedstop ) ) )
        ORDER BY rotator.displayorder ASC";
    $query = mysqli_query($myConnection,$sqlCommand) or die (mysqli_error($myConnection));

    $rotatorsDisplay = '';
    while ($row = mysqli_fetch_array($query)){
        $rotatorstitle = $row["title"];
        $rotatorsimg = $row["imgURL"];
        $rotatorsURL = $row["targetURL"];
        $rotatorscaption = $row["caption"];

        $rotatorsDisplay .= '<li>
                <a href="'. $rotatorsURL .'"><img src="'. $rotatorsimg .'"></a>
                <div id="title">'. $rotatorstitle .'</div>
                <div class="caption">'. $rotatorscaption .'</div>
            </li>';
    }
    mysqli_free_result($query);

The thing that’s causing me trouble is the $rotatorsimg variable. In the database, I have manually entered values for rotator.imageURL that look like this: ‘images/rotator/name.jpg’ but when I query them from the database, add them to the $rotatorsDisplay variable, then output them with this code:

    <?php echo $rotatorsDisplay; ?> 

All I get in the resulting page is this:

    <a href="doctor.php"><img src=""></a>

I’m pretty sure the reason this isn’t working is the slashes in the URL. I’m also pretty sure I need to somehow encode/convert HTML to strip special characters from code I enter into my database, then decode/convert it back to HTML when I output it, but since I entered this info manually into the database using phpMyAdmin, I haven’t worked out how to do this yet.

Any help is appreciated!

  • 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-06-11T09:18:05+00:00Added an answer on June 11, 2026 at 9:18 am

    It looks like you’re using the wrong index key.

    $rotatorsimg = $row["imgURL"];
    

    should probably be

    $rotatorsimg = $row["imageURL"];
    

    since that’s what you’re querying from the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here is the code im having trouble with $key = array( 0 => sss,
I'm having little trouble creating a script working with URLs. I'm using urllib.urlopen() to
Having trouble with each function... Will try to explain by example... In my code,
Having trouble accessing javascript code in a mixed html/js ajax response. jQuery ajax doc
Having trouble with the following segment of code. I'm getting a parameter count mismatch.
I'm trying to rewrite URLs to a generic show_page.php script, but I'm having trouble
Having trouble with this code, wondering if I'm trying to achieve something impossible. I'm
I'm having trouble selecting links in my html. Here's the html I have: <div
I'm having trouble with redirecting urls using the .htaccess file. This is what my
I'm having trouble showing urls with redirect with an automation tool i'm using so

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.