View Single Post
Old 10-11-2004, 08:45 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
hey welcome to the site, and yes, we have a no flaming policy here so everyone feels comfortable asking any questions. even though it's 'code newbie' , we have some very very experienced people around too.

as for your question, tell us more about the structure of your data.

1. is this image actually stored in the database? or is it just a text url that is stored?

2. is there an id field in this table? if there is, then you can send an id in the url and call the information dynamically.

here is some pseudo code to generate a popup script:

PHP Code:
<script language="JavaScript">
function 
openWindow(id){
  var 
win window.open('somepage.php?p='+id,'somepage','width=400,height=500,scrollbars=no');
  
win.focus();
}
</script>
<a href="javascript:openSpecWindow('1442')">click here</a> 
now this is what somepage.php might look like:
PHP Code:
<?
// connect to database here
$result mysql_query("select text,image from table where id=".$_GET['id']);
if(
$row mysql_fetch_array($result)){
  echo 
"text = ".$row['text']."<br>
  <img src="
.$row['image'].">\n";
}
mysql_close();
?>
this implementation would be if you were storing the image path in the database, .. not the image itself.
__________________
Mike
sde is offline   Reply With Quote