I have code below that creates HTML tables on the fly to display Tables from an Antique website. As I loop through each item I want to store
a link to a more information page (yellow) where a customer can see additional views of each piece where each individual piece would have it’s
own page.
The image name is stored in the field
$row[‘frnimageclick’]. If I have a detail page for each item called name +
“detailpage.htm”, how to I concatinate name with
“detailpage.htm”, store it in a variable, and the insert it into the a href
link below (yellow)?
thanks for any input
<?php
// Make a MySQL Connection
mysql_connect("localhost", "chuck", "**********") or die(mysql_error());
mysql_select_db("chuck_main") or die(mysql_error());
// Retrieve all tables
//$result = mysql_query("SELECT frndescshort, envyear, frnimageclick, frnstyle FROM inventory WHERE frnsubtype = 'drlf' OR frnsubtype = 'stds'") or die(mysql_error());
// Testing all inventory in tables
$result = mysql_query("SELECT frndescshort, envyear, frnimageclick, frnstyle FROM inventory") or die(mysql_error());
//Save for adding the HTML & and CSS
$num = @mysql_num_rows($result);
// you choose how many columns you want to display in each table row
$cols=2; // Here we define the number of columns
//testing the layout
//echo "<table border='4' bordercolor='green' align = 'center'>"; // The container table with $cols columns
echo "<table border='1'>";
// Outer loop creating rows
do{
//Start a new row
echo "<tr>";
//testing
//echo "<td> Outer table </td>";
// inner loop creating columns
for($r=1;$r<=$cols;$r++) {
// echo the actual data to the screen
$row = mysql_fetch_array( $result );
if($row){
echo "<td>";
//testing the layout
echo "<table border='1'>";
//echo "<table border='0'>";
echo '<tr valign="top">';
// Images should all be the same size to display properly
// For testing point to images when retrieving all inventory
//echo "<td width='250px' height='250px'><img src='images/AntiquePics/Tables/".$row['frnimageclick']."' />'</td>";
echo "<td width='250px' height='200px'><img src='images/".$row['frnimageclick']."' />'</td>";
echo "<td width='250px' height='200px'>";
echo "Period/Date : ".$row['envyear'];
echo "<br />";
echo "Style : ".$row['frnstyle'];
echo "<br />";
echo "Description :".$row['frndescshort'];
// to display only the field
// echo $row['frndescshort'];
echo "<br />";
[COLOR="Yellow"]echo '<a href="menu-item-3.htm">More Information</a> <strong font style="color: #ffffff;">.</strong>  ';[/COLOR] echo "<br />";
echo "</td>";
// echo '<td width="50"> </td>';
echo "</tr>";
echo "</table>";
echo "</td>";
}
else{
// echo "<td> </td>"; //If there are no more records at the end, add a blank column
}
}
echo "</tr>";
} while($row);
echo "</table>";
?>