473,320 Members | 1,859 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.

Printing image.

PHP Version:4.3.9 win32

Problem: I try to print the image from table dollsimage , gameandtoyname and the pricetype from dolls. (i have 7 images and 7 gameandtoyname), but This code prints only 3 borders.
What i am doing wrong? i think the problem is with the $str.
Pleas help!

[PHP]
<?php


$sql = ("SELECT gameandtoyname, pricetype, dollsimage.image_id, dollsimage.image_date
FROM dollsimage, dolls
WHERE dollsimage.image_id = dolls.image_id
ORDER BY image_date DESC");

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

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

$str = "";
if (mysql_num_rows($result) > 0)


{
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {

$i++;
$image_id = $row["image_id"];
$gameandtoyname = $row["gameandtoyname"];
$pricetype = $row["pricetype"];
$str .="$i. <img border='1' height='90' width='100' src='imagedolls.php?act=view&iid=$image_id$gameand toyname$pricetype'></a> ";

}
print $str;
}



?>

[/PHP]
Oct 17 '06 #1
4 2181
brid
13
Need a code from script: imagedolls.php.
Problems in it or wrong parameters for it.
Oct 18 '06 #2
Sir here is the imagedolls.php:

Thanks

[PHP]
<?php


// database connection
$conn = mysql_connect("localhost", "root") OR DIE (mysql_error());
@mysql_select_db ("products", $conn) OR DIE (mysql_error());
$sql = "SELECT * FROM dollsimage WHERE image_id=".$_GET["iid"];
$result = mysql_query ($sql, $conn);
if (mysql_num_rows ($result)>0) {
$row = @mysql_fetch_array ($result);
$image_type = $row["image_type"];
$image = $row["image"];
Header ("Content-type: $image_type");
print $image;
}
?>

[/PHP]
Oct 18 '06 #3
brid
13
Hm-m, script is clear.
In your database must be record where field
image_id=$image_id$gameandtoyname$pricetype
or
you have mistake in here:
src='imagedolls.php?act=view&iid=$image_id$gameand toyname$pricetype'
try correct to:
src='imagedolls.php?act=view&iid=$image_id'
Oct 19 '06 #4
Hm-m, script is clear.
In your database must be record where field
image_id=$image_id$gameandtoyname$pricetype
or
you have mistake in here:
src='imagedolls.php?act=view&iid=$image_id$gameand toyname$pricetype'
try correct to:
src='imagedolls.php?act=view&iid=$image_id'
Thanks alot. You did help me.
Oct 19 '06 #5

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

Similar topics

4
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
0
by: JF Turcotte | last post by:
Hi I'm unsuccessfully trying to print a form's image under VB.NET. To print under .NET is a real pain in the , I find it to be complex, lenghty, confusing, upsetting and ultimately not to be...
0
by: Gary | last post by:
Hi, I am getting this error within vb.net when i try and print to a printer... "Value cannot be null." the line "e.Graphics.DrawImage9me.PictireBox1.Image,0,0)" is highlighted. My code...
5
by: Senthil Kumar | last post by:
hi Group, Iam developing one Component in c#.It will load any kind of image either from Local machine or URL.Finally I do have options for printing and preview. While printing Iam facing the...
5
by: VMI | last post by:
I have a BMP image (the form is also in PDF) that contains a scanned copy of a paper form that we need to fill out. Is it possible to use this image in my application so that the application can...
3
by: D Witherspoon | last post by:
No matter what I do the default paper size is always either A3 or 11 by 8.5 .. Here is the code. Dim dlg As DialogResult pd.DocumentName = "Weld Image" Dim pkPaperSize As New...
1
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
2
by: user | last post by:
Hi all... i am trying to print an image using GDI - but the only thing i get is a black rectangle. Does anybody know what is wrong, or how else to get the bitmap on the printer (GDI+ is not...
0
by: gnewsgroup | last post by:
In my asp.net 2.0 web application. I create chart images on the fly by getting the data from the database. These chart images all have fixed width, but the height is dynamic depending on the...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.