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

  • Home
  • SEARCH
  • 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 9022457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:30:54+00:00 2026-06-16T05:30:54+00:00

is there other way to use iframe for showing the retrieved mysql database query

  • 0

is there other way to use iframe for showing the retrieved mysql database query result?

i have these codes now but it’s not working,

<iframe id="editor" style="width:500px; height:300px;" value="<?=$textContent?>"></iframe>

but when i tried it on textarea, it shows the query result.

<textarea value="<?=$textContent?>"> </textarea>

here’s my database query if it would be helpful,

<?php 
// Connect to server and select database.

$query="SELECT * FROM text_tb WHERE textID ='".$textID."'"; 
$result=mysql_query($query);
while($row=mysql_fetch_array($result)) { 
    $textID = $row['textID'];
    $textContent = $row['textContent'];
    } 
?> 

thank you for the help.

  • 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-16T05:30:55+00:00Added an answer on June 16, 2026 at 5:30 am

    If the PHP code is running on the same page as the iFrame you want, you are going to have to use JavaScript to “inject” the HTML into it.

    <?php 
    // Connect to server and select database.
    
    $query="SELECT * FROM text_tb WHERE textID ='".$textID."'"; 
    $result=mysql_query($query);
    while($row=mysql_fetch_array($result)) { 
        $textID = $row['textID'];
        $textContent = $row['textContent'];
    } 
    ?>
    
    <iframe id="editor" style="width:500px; height:300px;"></iframe>
    
    <script>
    window.onload = function(){
        window.frames.editor.document.body.innerHTML = <?=json_encode($textContent);?>;
    }
    </script>
    

    You can also put that PHP code in a different page, and set the iFrame’s “src” to that URL.

    results.php

    $query="SELECT * FROM text_tb WHERE textID ='".$textID."'"; 
    $result=mysql_query($query);
    while($row=mysql_fetch_array($result)) { 
        $textID = $row['textID'];
        $textContent = $row['textContent'];
    }
    
    echo $textContent;
    ?>
    

    main page

    <iframe id="editor" src="results.php" style="width:500px; height:300px;"></iframe>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to use an iframe or some other method of showing
So is there any other way to use mysql database with django app on
Is there a way to use the HAVING clause in some other way without
Is there a way to search on www.qantas.com.au or other sites that don't use
Is there any other way to get datetime field from oracle database in 24hour
Is there any other way in java to implement call backs apart from inner
Is there any other way to change the QTextLayout of a QTextBlock that is
Is there any other way to write javascript:false that is more pleasant? I'm building
Is there any other way of creating a conditional execution? way 1 : the
is there any other way to know if the java String contains character-encoding in

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.