img1.php
Expand|Select|Wrap|Line Numbers
- <?php
- $con=mysql_connect('localhost','root','');
- $d=mysql_select_db("test");
- $q1="select * from cat ";
- $r1=mysql_query($q1);
- while($r=mysql_fetch_array($r1))
- {
- header("Content-type: image/jpeg");
- print $r['image'];
- }
- ?>
Expand|Select|Wrap|Line Numbers
- <?php
- $con1=mysql_connect('localhost','root','');
- $d1=mysql_select_db("test");
- $q2="select * from cat";
- $r2=mysql_query($q2);
- //$r3=mysql_fetch_array($r2);
- ?>
- <table border="1">
- <tr>
- <td>id</td>
- <td>name</td>
- <td>image</td>
- </tr>
- <?php
- while($r3=mysql_fetch_array($r2))
- {
- ?>
- <tr>
- <td><?php echo $r3['id']; ?></td>
- <td><?php echo $r3['name']; ?></td>
- <td><img src="img4.php" height="100" width="100" /></td>
- </tr>
- <?php
- }
- ?>
- </table>