...

View Full Version : click on image.



ggp
11-17-2006, 12:43 AM
Hi and thanks for any help.

I am not sure of all i need to make this works:

I have a page textimage20.php It prints 6 images from a table dollsimage and some information from table doll.

Now i need the link to click any of this images and take me to text4.php page and display the same image from dollsimage table and some extra information from doll table.

What SELECT should be in text4.php so the id brings dollsimage.image_id,
the gameandtoyname and the extra nformation :bigdescription


This is my link and SELECT in textimage20.php:





<?php

$sql = ("SELECT gameandtoyname, pricevalue, dollsimage.image_id, dollsimage.image_date, dolls.pricetype, prices.pricetype, prices.pricevalue
FROM dollsimage, dolls, prices
WHERE dollsimage.image_id = dolls.image_id and dolls.pricetype = prices.pricetype
ORDER BY image_date DESC LIMIT $from, $max_results");

$result = mysql_query ($sql, $conn);

if (!$result) {
die('Invalid query: ' . mysql_error());
}


echo '<TD> <a href="http://localhost/text4.php"> <img border="1" height="90" width="100"
src="imagedolls.php?act=view&iid=' . $row['image_id'] . '"> </a> ';

echo '<BR>' .$row['gameandtoyname'] ;


$row['pricevalue'] = number_format($row['pricevalue'],2, '.', '');
echo '<br>';
echo '$' .$row['pricevalue']. '</TD>';;

?>

SeeIT Solutions
11-17-2006, 03:38 AM
SELECT gameandtoyname, dollsimage.image_id, bigdescription
FROM dollsimage, dolls, prices
WHERE dollsimage.image_id = '$_GET['iid']'
ORDER BY image_date DESC LIMIT $from, $max_results


Something like that

ggp
11-17-2006, 04:55 AM
Hi and thanks.

Now i get this error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\Program Files\Online Services\Apache2\htdocs\text4.php on line 24

line 24:
$sql = ("SELECT gameandtoyname, pricevalue, bigdescription, dollsimage.image_id, dollsimage.image_date, doll.pricetype, prices.pricetype, prices.pricevalue
FROM dollsimage, doll, prices
WHERE doll.pricetype = prices.pricetype and dollsimage.image_id = '$_GET['iid']' and doll.gameandtoyname = '$id' and doll.bigdescription = '$id'
");


I did add the GET in text4.php like this:





<?php


$sql = ("SELECT gameandtoyname, pricevalue, bigdescription, dollsimage.image_id, dollsimage.image_date, doll.pricetype, prices.pricetype, prices.pricevalue
FROM dollsimage, doll, prices
WHERE doll.pricetype = prices.pricetype and dollsimage.image_id = '$_GET['iid']' and doll.gameandtoyname = '$id' and doll.bigdescription = '$id'
");
echo "$sql <br>";

$result = mysql_query ($sql, $conn);

if (!$result) {
die('Invalid query: ' . mysql_error());
}






echo "<TABLE BORDER=\"1\">\n";


$row = mysql_fetch_array($result);

echo '<TD> <img border="1" height="90" width="100"
src="imagedolls.php?act=view&iid=' . $row['image_id'] . '"> ';

echo '<BR>' .$row['gameandtoyname'] ;
echo '<BR>' .$row['bigdescription'] ;

$row['pricevalue'] = number_format($row['pricevalue'],2, '.', '');
echo '<br>';
echo '$' .$row['pricevalue']. '</TD>';



?>

SeeIT Solutions
11-18-2006, 07:38 AM
I think you just need to concatenate the variable because it is an associative array.

Try the code below.


<?php


$sql = ("SELECT gameandtoyname, pricevalue, bigdescription, dollsimage.image_id, dollsimage.image_date, doll.pricetype, prices.pricetype, prices.pricevalue
FROM dollsimage, doll, prices
WHERE doll.pricetype = prices.pricetype and dollsimage.image_id = '".$_GET['iid']."' and doll.gameandtoyname = '".$id."' and doll.bigdescription = '".$id."'
");
echo "$sql <br>";

$result = mysql_query ($sql, $conn);

if (!$result) {
die('Invalid query: ' . mysql_error());
}






echo "<TABLE BORDER=\"1\">\n";


$row = mysql_fetch_array($result);

echo '<TD> <img border="1" height="90" width="100"
src="imagedolls.php?act=view&iid=' . $row['image_id'] . '"> ';

echo '<BR>' .$row['gameandtoyname'] ;
echo '<BR>' .$row['bigdescription'] ;

$row['pricevalue'] = number_format($row['pricevalue'],2, '.', '');
echo '<br>';
echo '$' .$row['pricevalue']. '</TD>';



?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum