473,326 Members | 2,173 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,326 software developers and data experts.

how to display/print images in 4x2 format.

254 100+
Hi

I am facing problem while displaying the images dynamically on the webpage from database. Actually I am saving the path of the Image in database and it is displaying it from there .but it is displaying one image per row in table.

and I want to display two image per row in table.

for retriving data from data i am using ------ mysql_fetch_array() function.

so it is returning one image per page.

Please tell me how can I print two image per row in table from database like?

[IMG]image1[/IMG] [IMG]image2[/IMG]

[IMG]image3[/IMG] [IMG]image4[/IMG]

in this way.

please help me out.
Dec 14 '07 #1
5 1759
aktar
105 100+
Your question is a bit ambigious.

If you HAVE both images and you cant display them in a row

TRY=> a css float option eg style="float:left"

OR

If you are having problem retrieving both the imges?

TRY=> store the images with a common id name + unique identifier,eg

image1 >> record1_1.jpg
image2 >> record1_2.jpg

then use a function such as glob() to extract the files eg
glob("record1_*")

regards
Dec 15 '07 #2
stepterr
157 100+
I do something similar on a page of mine, but its 3 columns. This may not be the most efficient way, someone else may have a better solution for you, but it works perfectly for what I wanted.

[PHP]
$result = mysql_query("SELECT * FROM portfolio WHERE dcategory = 'Y' ORDER BY ppriority")or die(mysql_error());
$numcols = 0;
if ($result)
{
while ($array= mysql_fetch_assoc($result))
{
if ($numcols < 3)
{
?>
<td class='bodyText'><?php echo $array[category]?><br><img src='<?php echo $array[location]?>' style='cursor: pointer;' name='Thumbnails' border'0' onclick='OpenWindow("<?php echo $array[category]?>","<?php echo $array[projectname]?>")'/></td>
<?php
$numcols ++;
}
else
{
$numcols =0;
?>
<tr><td class='bodyText'><?php echo $array[category]?><br><img src='<?php echo $array[location]?>' style='cursor: pointer;' name='Thumbnails' border'0' onclick='OpenWindow("<?php echo $array[category]?>","<?php echo $array[projectname]?>")'/></td>
<?php
}
}
}
[/PHP]
Dec 15 '07 #3
mukeshrasm
254 100+
Your question is a bit ambigious.

If you HAVE both images and you cant display them in a row

TRY=> a css float option eg style="float:left"

OR

If you are having problem retrieving both the imges?

TRY=> store the images with a common id name + unique identifier,eg

image1 >> record1_1.jpg
image2 >> record1_2.jpg

then use a function such as glob() to extract the files eg
glob("record1_*")

regards

Hi aktar

I am able to retrieve all the images but thing is that it is coming in a single column but I want it to come in two column dynamically.
Dec 15 '07 #4
Markus
6,050 Expert 4TB
Hi there mukesh,

check out this thread i started a while ago. I had the same problem and pbmods gave me an excellent solution.

The solution - you might have to change a few little bits to adapt it. If you need some help just ask.

-markus
Dec 15 '07 #5
mukeshrasm
254 100+
Hi there mukesh,

check out this thread i started a while ago. I had the same problem and pbmods gave me an excellent solution.

The solution - you might have to change a few little bits to adapt it. If you need some help just ask.

-markus
Hi Markusn

Need your help!. I am confused in the code so if you can please give me the code which is there at that link, because there is === and !==. and I am not sure that where will I put the code for dummy cell.

Please help me.
Dec 18 '07 #6

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

Similar topics

6
by: Paul | last post by:
I have a text file that I am trying to display on a web page. If I cat or more the file it formats and displays fine. When it comes up in the browser it seems to loose tabs and the format gets...
3
by: Steve Castellotti | last post by:
Hey all-- I have a simple photo website written in python. I would like to be able to use Python Imaging Library (or similar) to read an image file from the disk, resize/thumbnail it in memory,...
2
by: david | last post by:
Hi, I have asp pages running from a MySQL database. I have placed a path in the required field (although not quite sure on the correct format). My asp page is just displaying the text path...
5
by: david | last post by:
Can I use WriteFile methods? It seems that it does not work. For example, the following code only dispay one figure. Response.WriteFile("images/image002.jpg") Response.Write("<br><p>")...
5
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page...
0
by: adubra | last post by:
Hi there, I am using a device context (DC) and a buffer to successfully draw to screen. However, when I update the DC at very high frame rate and drag the frame containing the image very quickly...
1
by: eqiz | last post by:
I'm looking for a way to print stuff from my program. I have searched and searched for a way to print and the only thing I have found is PrintFORM which only takes a picture of the form and prints it...
11
by: nse111 | last post by:
<?php //header('Content-Type: image/jpeg'); header('Content-Type: text/html'); @mysql_connect("localhost","root","dba") or die("Error"); @mysql_select_db("gallery"); $result =...
6
by: rgagarrett | last post by:
Hi, I hope this is the correct group for my query, please advise if there's a more relevant place for me! I'm using a USB camera (Sentech C83) with Linux and I have some C code for reading data...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: 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...
1
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: 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...
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.