473,788 Members | 2,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to display/print images in 4x2 format.

254 Contributor
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_arr ay() 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 1773
aktar
105 New Member
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:le ft"

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 New Member
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("SE LECT * FROM portfolio WHERE dcategory = 'Y' ORDER BY ppriority")or die(mysql_error ());
$numcols = 0;
if ($result)
{
while ($array= mysql_fetch_ass oc($result))
{
if ($numcols < 3)
{
?>
<td class='bodyText '><?php echo $array[category]?><br><img src='<?php echo $array[location]?>' style='cursor: pointer;' name='Thumbnail s' border'0' onclick='OpenWi ndow("<?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='Thumbnail s' border'0' onclick='OpenWi ndow("<?php echo $array[category]?>","<?php echo $array[projectname]?>")'/></td>
<?php
}
}
}
[/PHP]
Dec 15 '07 #3
mukeshrasm
254 Contributor
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:le ft"

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 Recognized Expert Expert
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 Contributor
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
20701
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 messed up. This is how I display the file. $show = file("./fields/combined/$cdp$store"); $arrayitems = sizeof($show); $x=0; while ($x < $arrayitems) { print("$show\n");
3
3268
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, and then print the modified image to stdout (sending it to the client web browser after the proper MIME headings). Currently, I have only managed to do this via Image.save() to a temporary file and then sending that, but of course that
2
2278
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 instead of the image. I'm using response.write. The Folder is called : images
5
2953
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>") Response.WriteFile("images/image003.jpg") Response.Write("<br><p>") Any help? Thanks
5
5044
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 that calls the web service to render a vertical strip of images. After doing some research I am unable to find some vb.net code that can assist in what I want to achieve. The closest thing I found was
0
2469
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 over the screen or I drag another window on top of the fast display, I get errors (Pyassertion ....). I believe those are related to a conflict between the thread that is updating the buffer (over which I have control) and the thread that is doing the...
1
1642
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 in image quality which is really really bad quality. Is there any way to print the text off my form the way it looks and everything? Like how PrintForm prints but instead printing the text in "text quality" and the images in image quality? Im...
11
10824
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 = mysql_query("SELECT * FROM paintings"); while($row = mysql_fetch_assoc($result)){ print $row."</br>"; //print $row; }
6
2769
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 from the driver and writing it to disk. The data are images in raw format and so I need to convert them to jpeg (or bmp) before I can view them in a standard image viewer. My problem is that I'd like to display the raw images that I get from...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5402
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.