473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

what is wrong with this code

I click on a image on textimage20.php
It takes me to text4.php but it all displays is:

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 = '123' and doll.gameandtoyname = '123' and doll.bigdescription = '123'

Then I see the border, an X in there for the image
And then $0.00

Thank you for any help.

This is my code:


Textimage20.php


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


text4.php :

[HTML]
[PHP]
$id = $_GET['image_id'];

$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 = '$id' and doll.gameandtoyname = '$id' and doll.bigdescription = '$id'
");
echo "$sql <br>";



$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'].

[/PHP]
[/HTML]
Nov 16 '06 #1
3 1138
Velhari
46
I click on a image on textimage20.php
It takes me to text4.php but it all displays is:

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 = '123' and doll.gameandtoyname = '123' and doll.bigdescription = '123'

Then I see the border, an X in there for the image
And then $0.00

Thank you for any help.

This is my code:


Textimage20.php


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


text4.php :

[HTML]
[PHP]
$id = $_GET['image_id'];

$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 = '$id' and doll.gameandtoyname = '$id' and doll.bigdescription = '$id'
");
echo "$sql <br>";



$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'].

[/PHP]
[/HTML]
Hi,
I think the mistake made by you is you didn't include the following statement in your code, if this is included means it might been successfull to you

[PHP]$result = mysql_query($sql);[/PHP]

With Regards,
Velmurugan.H
Nov 16 '06 #2
I do have the statement : $result = mysql_query ($sql, $conn);

Here is the code again


textimage20.php :


[HTML]
[PHP]
echo '<TD> <a href="http://localhost/text4.php?image_id=123"> <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>';

[/HTML]
[/PHP]

text4.php :

[[HTML]
[PHP]
<?php


$id = $_GET['image_id'];

$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 = '$id' 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>';


[/PHP]
[/HTML]


?>





Hi,
I think the mistake made by you is you didn't include the following statement in your code, if this is included means it might been successfull to you

[PHP]$result = mysql_query($sql);[/PHP]

With Regards,
Velmurugan.H
Nov 16 '06 #3
try by removing this line from text4.php

echo "$sql <br>";

mysql select statment is being printed out in html

good luck and take care
Nov 17 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
72
by: E. Robert Tisdale | last post by:
What makes a good C/C++ programmer? Would you be surprised if I told you that it has almost nothing to do with your knowledge of C or C++? There isn't much difference in productivity, for...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
51
by: WindAndWaves | last post by:
Can anyone tell me what is wrong with the goto command. I noticed it is one of those NEVER USE. I can understand that it may lead to confusing code, but I often use it like this: is this...
46
by: Keith K | last post by:
Having developed with VB since 1992, I am now VERY interested in C#. I've written several applications with C# and I do enjoy the language. What C# Needs: There are a few things that I do...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
1
by: GS | last post by:
I got a combobox box that I load at load time. the Item and vales ended up in reverse order of each other, what went wrong? the database table has the following row code value ebay ...
98
by: tjb | last post by:
I often see code like this: /// <summary> /// Removes a node. /// </summary> /// <param name="node">The node to remove.</param> public void RemoveNode(Node node) { <...> }
9
by: Pyenos | last post by:
import cPickle, shelve could someone tell me what things are wrong with my code? class progress: PROGRESS_TABLE_ACTIONS= DEFAULT_PROGRESS_DATA_FILE="progress_data" PROGRESS_OUTCOMES=
20
by: Daniel.C | last post by:
Hello. I just copied this code from my book with no modification : #include <stdio.h> /* count characters in input; 1st version */ main() { long nc; nc = 0;
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.