I have a page that sends an imageid # to another page. On the new page I recieve the output from the other page and call a querry it doesn't give me the right info back. This is the code I am using to recieve the info.
title page:
<?
$database = "ctsolidsurface_com";
mysql_connect(localhost, ******, ****);
mysql_select_db($database);
import_request_variables('imageid');
$corianid = $_REQUEST['imageid'];
$id2 = number_format($corianid);
$query = ("SELECT * FROM corian");
$result = mysql_query($query) or die(mysql_error());
echo mysql_result($result,$id2,name);
echo " - CT Solid Surface";
echo $id2;
?>
main page:
<html>
<head>
<title>
<?php include "corian-color-title.php"; ?>
</title>
</head>
<body topmargin="0" leftmargin="0">
<?
echo "<br><p align=\"center\"><b><font size=\"5\" color=\"#AB6254\">";
echo mysql_result($result,$id2,name);
echo "</font></b></p>";
echo "<p align=\"center\"><img border=\"0\" src=\"http://www.ctsolidsurface.com/corian/colors/images/large/CC_";
$name = mysql_result($result,$id2,name);
$name = str_replace(" ","",$name);
echo $name;
echo "_lg.jpg\"></p>";
echo $id2
?>
</body>
</html>
My page is here
The numbers following the image name is the correct record number. When you click on the photo a new window opens and at the bottom is the record number that gets passed but the image and image name are both wrong they don't match the record.
Hope I explained mysefl good enough. Please help