473,473 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

I am trying to display images side by side from mysql database using php, i want 4

5 New Member
----- this is my image.php file---- for getting id----

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2.  include('connect.php');
  3.      if (isset($_GET['id'])) 
  4.      {
  5.     $gotten =mysql_query("select  *from reg  where id=".$_GET['id']);
  6.     while ($row = mysql_fetch_array($gotten))
  7.     {
  8.     echo $row['id']; 
  9.      }
  10.     mysql_free_result($gotten);
  11.     }
  12.     ?>
-----imagefetcher.php------

Expand|Select|Wrap|Line Numbers
  1.  <html> <head> <title>home page</title> </head> <?php 
  2. include("connect.php");
  3.  $strSQL = "select * from reg";
  4. $rsPix = mysql_query($strSQL);
  5. $numRows = mysql_num_rows($rsPix);
  6. $i = 0;
  7. ?> <table border="1"> <tr> <?php
  8.       while($i<$numRows)
  9.      {
  10.      ?> <td> <img src="http://bytes.com/image.php?id=<?php echo mysql_result($rsPix,$i,"id"); ?>"/></a> </td> <?php
  11.       $i++;
  12.           if ($i%3==0)
  13.           {
  14.        ?> </tr> <tr> <?php
  15.          }
  16.         ?> <?php
  17.          }
  18.         ?> <?php
  19.         if ($numRows%3>0)
  20.         {
  21.         ?> <td "colspan="<?php echo $numRows%3; ?>">*</td> <?php
  22.         }
  23.         ?> </tr> </table> </body> </html>
Mar 11 '14 #1
7 2077
Dormilich
8,658 Recognized Expert Moderator Expert
and what’s the problem?
Mar 12 '14 #2
nili
5 New Member
where can i use
Expand|Select|Wrap|Line Numbers
  1.  and 
tages please tell me as i am new for php me it will be helpfull if you guide me
Mar 12 '14 #3
nili
5 New Member
problem is images are not display its just giving table with image icon but images are not displays
Mar 12 '14 #4
Dormilich
8,658 Recognized Expert Moderator Expert
if you only see the image icon it means that either the image URL is invalid or that the URL didn’t return an image.

in this case the latter because:
- the URL returns an HTML page (without the tags, though)
- effectively you return what you pass in (though in a very complicated way)
Mar 12 '14 #5
nili
5 New Member
i use varchar datatype to store images in database is that possible this may be error ?and the mysql_result is use for blob datatype
Mar 14 '14 #6
Dormilich
8,658 Recognized Expert Moderator Expert
i use varchar datatype to store images in database is that possible this may be error ?
no. the error is that image.php doesn’t return an image.
Mar 14 '14 #7
nili
5 New Member
thanks for your reply let me play with image.php
Mar 14 '14 #8

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

Similar topics

0
by: Dan Anderson | last post by:
I have created a BLOB field to store images. Is there any way to embed them within HTML with something like: <image start: jpeg> </image> Thanks in advance, Dan
8
by: menmysql | last post by:
i am not bale to solve this problem since two weeks i am trying to access records from mysql database using jsp. inside this jsp program i wrote all my JDBC code. it is working very nicely and...
9
by: christopher_board | last post by:
Hi all. I am trying to connect to a MySQL Database using PHP on a local machine using locahost. I am using the following code <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass =...
3
by: WiseG1rly | last post by:
Hey everyone! I am completley new and I will start off by saying that I am not a programmer - figuring out this search took so long! I am debugging now and would appreciate any help :) ...
3
by: Suresh P | last post by:
Hi All, I tried to access the mysql database in ODBC using ip address and username/password. It returns, "cannot connect to MySQL server on IP ADDRESS(10060)". This could be related to Firewall...
1
by: nadeenahmed | last post by:
I have Connected to a MySQL Database using a neatbeans editor. Now, I want to use that same database I created earlier on another pc. Can anyone help and tell me how that is done, please? Thank...
6
by: mfaisalwarraich | last post by:
Hi everyone, I am trying to add multiple pinpoint to google map using Lon/Lat. All addresses will be fetched from mysql database using PHP. I have looked at google and searched for it on...
1
by: santhanalakshmi | last post by:
Hi, I wrote some coding, to import excel data in mysql database using PHP Script? But my script, its not all inserting the excel data in mysql database. I don't know, what mistake did i made?...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.