Jump to content

Recommended Posts

I am trying to generate a page from my database where my last field is an Iframe link.  the problem is, the query works in the editor, but only displays the first iframe on the page.  All the other information for all the records is displayed, but the iframes are ignored after the first one.

 

here is my code (ignoring the connection details):

 

 

mysql_connect($hostname,$username, $password) OR DIE ("Unable to connect to database! Please try again later.");
mysql_select_db($dbname);

$query = "SELECT * FROM $usertable ";
$result = mysql_query($query);
if($result) {
    while($row = mysql_fetch_array($result)){
        $title = $row["$yourfield"];
        $year = $row["$myear"];
        $amazon = $row["$amazon"];
        echo "Title: ".$title;
        echo "<br>Year: ".$year;
        echo "<br>".$amazon;
        echo "<br>";

    }
}

 

 

 

Can anyone shed some light onto why this is happening?

 

TIA

Link to comment
https://forums.phpfreaks.com/topic/45209-php-problem-multiple-iframes/
Share on other sites

This is the first iframe (displays)

<iframe src="http://rcm.amazon.com/e/cm?t=retrostuff-20&o=1&p=8&l=as1&asins=B000B5XOWA&fc1=000000&IS2=1&lt1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>

 

And this is the second (won't generate to html)

<iframe src="http://rcm.amazon.com/e/cm?t=retrostuff-20&o=1&p=8&l=as1&asins=6302999456&fc1=000000&IS2=1&lt1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>

 

this is exactly how both are stored in the database

Try adding a unique name to each and see what happens.

 

ie:

 

<iframe name="iframe1" src="http://rcm.amazon.com/e/cm?t=retrostuff-20&o=1&p=8&l=as1&asins=B000B5XOWA&fc1=000000&IS2=1&lt1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>

<iframe name="iframe2" src="http://rcm.amazon.com/e/cm?t=retrostuff-20&o=1&p=8&l=as1&asins=B000B5XOWA&fc1=000000&IS2=1&lt1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.