bim Posted April 2, 2007 Share Posted April 2, 2007 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 More sharing options...
MadTechie Posted April 2, 2007 Share Posted April 2, 2007 more of a HTML problem that a php one Link to comment https://forums.phpfreaks.com/topic/45209-php-problem-multiple-iframes/#findComment-219503 Share on other sites More sharing options...
bim Posted April 2, 2007 Author Share Posted April 2, 2007 ordinarily i would agree, but the iframes after the first aren't in the html(while the rest of the record data is) . That leads me to believe PHP is at fault somehow.... Link to comment https://forums.phpfreaks.com/topic/45209-php-problem-multiple-iframes/#findComment-219515 Share on other sites More sharing options...
per1os Posted April 2, 2007 Share Posted April 2, 2007 Your not even showing the code where the iframes get displayed...it is most likely a conflict in that code. Link to comment https://forums.phpfreaks.com/topic/45209-php-problem-multiple-iframes/#findComment-219529 Share on other sites More sharing options...
bim Posted April 2, 2007 Author Share Posted April 2, 2007 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<1=_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<1=_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 Link to comment https://forums.phpfreaks.com/topic/45209-php-problem-multiple-iframes/#findComment-219532 Share on other sites More sharing options...
per1os Posted April 2, 2007 Share Posted April 2, 2007 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<1=_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<1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe> Link to comment https://forums.phpfreaks.com/topic/45209-php-problem-multiple-iframes/#findComment-219559 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.