troubleshooting Question

store and call specific mysql records from a query in a javascript window.open() function

Avatar of Ron McCain
Ron McCainFlag for United States of America asked on
AJAXPHPJavaScript
9 Comments1 Solution279 ViewsLast Modified:
we have a ajax, php,mysql search script that gets records from a mysql dbase and list them in a table. the user can then select any of the found items and have a detail page returned.

we have a typical href script working to do this however what we need is to open the found item detail page(s) in a new browser window using the window.open() function.

We have this working, however selecting the window.open() function for any of the found items always calls the last record found when the query ran.

Below is the script producing this result, please assist so that we can get the window.open() to get the correct found item record.


.....mysql connects and queries database..............

while($row=mysql_fetch_array($sql))
{

      
?>
<font size=2 color="#000000" face="Arial">
<div align="left"><table width="100%" border="1" cellpadding="0"  cellspacing="0" bgcolor="#ffcc99">
<td width="95"><font size=2 color="#000000" face="Arial">
<div>Issue Date:</div>
</font>
</td>


<?php

$_SESSION['mainproduct']=$row['brand_wwb'];
$_SESSION['prod_selected_pkid']=$row['prodwwb_pkid'];


=====this script calls detail page and sends correct id for the appropriate found item

$prodsec1= "http://192.x.x.x/url_path/".$row['brand_wwb']."/".$row['type_wwb']."/".$call_detail_page."?prodwwb_pkid=".$row['prodwwb_pkid'].'">';



?>
<script type="text/javascript">
function open_win_article()
{
            
      window.showModelessDialog('<?php echo $prodsec1; ?>','<?php echo $prodsec1; ?>',"dialogHeight: 725px; dialogWidth: 850px; dialogTop: 150px; dialogright: 450px; edge: Raised; center: yes; help: No; scroll: yes; status: no;")
      
}

</script>

<input type="button" value="Review This Item" onclick="open_win_article()" />

<td width="434"><?php echo $row['model_wwb']; ?> <br />
</td>
</tr>

=========
As stated with the above script we  always get the last found item record from the query, and to restate, a typival href() script always works to get the correct found item as selected from the found item display table.

We can provide more info if need, we are in a bit of a hurry so any fast help will be appreciated.
Thanks
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros