Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Apr 2006
    Posts
    311
    Thanks
    17
    Thanked 0 Times in 0 Posts

    echo/print array to echoed iframe??

    Hey All,
    Struggling to get query results from the following aray fromated and returned into an echoed Iframe.
    No doubt this a real crackpot approach, but here's where I'm headed.

    PHP Code:
    $select_account_id "select id, name from accounts where name Like '%$search_account%'";
    $result = @mysql_query ($select_account_id)or die ("Query failed-account_id"); // Run the query. 
    while ($row=mysql_fetch_array($result)) { 
    $accountID $row["id"]; 
    $accountName $row["name"]; 
    $acct_list[] = "$accountID , $accountName"
    }
    foreach (
    $acct_list as $list){
    echo 
    $list ."<br>"

    Which oututs something like
    1cc4e46f-00bd-2fc6-7a90-44fdadf21436 , Keller Williams Downtown
    258e18e6-2f8e-a28f-423a-453cf7ae0710 , Keller Williams South East
    2c89881a-7fe6-45f4-e555-46801c213916 , Keller Williams West Metro
    a90f9819-4533-c159-16c7-461a7d853bda , Keller Williams Advantage
    This is all well and good but I want to echo an Iframe with these list results formated
    with each id in a hidden input and each name hyperlinked to call
    the individual record values into an adjacent frame. Something like...
    PHP Code:
    $select_account_id "select id, name from accounts where name Like '%$search_account%'";
    $result = @mysql_query ($select_account_id)or die ("Query failed-account_id"); // Run the query. 
    while ($row=mysql_fetch_array($result)) { 
       
    $accountID $row["id"]; 
       
    $accountName $row["name"]; 
       
    $acct_list[] = "$accountID , $accountName"
       }
    echo
    '<iframe name="I1" src="about:blank" title="account matches">';
        foreach (
    $acct_list as $list){
        echo 
    $list ."<br>"
        }
    echo
    '</iframe>'
    Which of course has no chance of working but...
    Wow am I stumped! Maybe somebody can throw me bone?
    Last edited by fuzzy1; 08-18-2007 at 02:40 AM.

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    At the moment your list will only show if your browser doesn't support iframes.

    You could just put the iframe on a separate page with it's src as the PHP page which generates the list.

  • #3
    Regular Coder
    Join Date
    Apr 2006
    Posts
    311
    Thanks
    17
    Thanked 0 Times in 0 Posts
    Something happens, and you just can't see the forest for all those darned trees.
    OR - to coin a phrase - Duhh!!! Of course! That's just what I did.
    Thanks for the nudge Mwnciau!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •