...

View Full Version : echo/print array to echoed iframe??



fuzzy1
08-18-2007, 02:37 AM
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.


$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...
$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?

Mwnciau
08-18-2007, 02:41 AM
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.

fuzzy1
08-18-2007, 02:16 PM
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!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum