my problem is that i need to create a master detail page using a tool that i picked up from
www.dengjie.com that makes it possible to create a master detail page set in PHP.
my database schema is
ID: autonum
description: string
location: string
size: string
price: integer
code :string
comments string
thumbnail:string
alterpic :string
Masterpage = results cuprite
detailpage = infopage
the masterpage calls for all entries with the same name and when i click on a thumbnail of the product it must take me to the detail page.
code-results cuprite
-------------------------
<?php require_once('Connections/
mysql.php'
); ?> <?php
$colname_Recordset1 = "1";
$HTTP_Recordset1 = "cuprite";
if (isset($HTTP_SESSION_VARS[
'cuprite']
)) {
$HTTP_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_SESSION_VARS['cuprit
e'] : addslashes($HTTP_SESSION_V
ARS['cupri
te']);
}
mysql_select_db($database_
mysql, $mysql);
$query_Recordset1 = sprintf("SELECT * FROM cuprite WHERE Name = '%s' ORDER BY ID ASC", $HTTP_Recordset1);
$Recordset1 = mysql_query($query_Records
et1, $mysql) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Records
et1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1
);
?>
<title>results for cuprite</title>
<body bgcolor="#f3eeab"><div align="center">
<table width="75%" border="1">
<tr>
<td><div align="center"><font color="#990000" face="Arial, Helvetica, sans-serif"><strong><?php echo $row_Recordset1['Name']; ?></strong></font></div></
td>
</tr>
</table>
<table border="1" align="center" cellpadding="5" cellspacing="5">
<tr>
<td><div align="center">
<?php
do { // horizontal looper
?>
<a href="infopage.php?id=<?ph
p echo $row_Recordset1['CODE']; ?>"><img src="<?php echo $row_Recordset1['thumbnail
']; ?>" width="100" border="0"></a>
<?php
$row_Recordset1 = mysql_fetch_assoc($Records
et1);
if (!isset($nested_Recordset1
)) {
$nested_Recordset1= 1;
}
if (isset($row_Recordset1) && is_array($row_Recordset1) && $nested_Recordset1++%4==0)
{
echo "<br>";
}
} while ($row_Recordset1); //end horizontal looper
?>
</div></td>
</tr>
</table>
<p> </p>
</div>
<?php
mysql_free_result($Records
et1);
?>
code- Infopage
----------------------
<?php require_once('Connections/
mysql.php'
); ?>
<?php
$colname_Recordset1 = "1";
if (isset($HTTP_SESSION_VARS[
'ID'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_SESSION_VARS['ID'] : addslashes($HTTP_SESSION_V
ARS['ID'])
;
}
mysql_select_db($database_
mysql, $mysql);
$query_Recordset1 = sprintf("SELECT * FROM cuprite WHERE ID = %s", $colname_Recordset1);
$Recordset1 = mysql_query($query_Records
et1, $mysql) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Records
et1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1
);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=
a[i])&&x.o
Src;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_pre
loadImages
.arguments
; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&p
arent.fram
es.length)
{
d=parent.frames[n.substrin
g(p+1)].do
cument; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;
i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.
layers.len
gth;i++) x=MM_findObj(n,d.layers[i]
.document)
;
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arg
uments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=
3)
if ((x=MM_findObj(a[i]))!=nul
l){documen
t.MM_sr[j+
+]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onLoad="MM_preloadImages('
Buttons/Bu
y%20me_ON.
png','Butt
ons/buy%20
me_on.gif'
)">
<table width="75%" height="567" border="1">
<tr>
<td height="39" colspan="3"><div align="center"><?php echo $row_Recordset1['Name']; ?></div></td>
</tr>
<tr>
<td width="51%" rowspan="6"><div align="center"><img src="<?php echo $row_Recordset1['alterpic1
']; ?>"></div></td>
<td width="15%" height="33">
<div align="center">Description
</div></td
>
<td width="34%"><?php echo $row_Recordset1['DESCRIPTI
ON']; ?></td>
</tr>
<tr>
<td height="32">
<div align="center">Location</d
iv></td>
<td height="32"><?php echo $row_Recordset1['LOCALITY'
]; ?></td>
</tr>
<tr>
<td height="31">
<div align="center">Size</div><
/td>
<td height="31"><?php echo $row_Recordset1['SIZE']; ?></td>
</tr>
<tr>
<td height="30">
<div align="center">Price</div>
</td>
<td height="30"><?php echo $row_Recordset1['PRICE']; ?></td>
</tr>
<tr>
<td height="37">
<div align="center">Code</div><
/td>
<td height="37"><?php echo $row_Recordset1['CODE']; ?></td>
</tr>
<tr>
<td height="87" colspan="2"> </td>
</tr>
<tr>
<td height="122">
<div align="center"><a href="#" onMouseOut="MM_swapImgRest
ore()" onMouseOver="MM_swapImage(
'Image1','
','Buttons
/buy%20me_
on.gif',1)
"><img name="Image1" border="0" src="Buttons/buy%20me.gif"
></a></div
></td>
<td rowspan="2">
<div align="right">Comments:</d
iv></td>
<td rowspan="2"><?php echo $row_Recordset1['Comments'
]; ?></td>
</tr>
<tr>
<td height="134"> </td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($Records
et1);
?>
==========================
==========
====
any assistance would be great
midian
at first glance , it looks fine.
Rockman