1 town containing 338 data
2 address containing 500 data
i want to display town then related address
then again town then related address
and so on
but my code not working
kindly help
Expand|Select|Wrap|Line Numbers
- <?php
- session_start();
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title></title>
- <meta name="generator" content="Microsoft FrontPage 5.0" />
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta name="description" content="" />
- <meta name="keywords" content="" />
- <meta name="author" content="" />
- <link rel="stylesheet" href="../include/style.css" type="text/css" />
- </head>
- <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
- <?php require("../include/header.php"); ?>
- <?php require("../include/left.php"); ?>
- <div class="heading">
- welcome all
- </div>
- <div class="text">
- <?php
- $sql2 = mysql_query("select * from town");
- //echo $sql2;
- //exit();
- if(!$sql2) { echo mysql_error();}
- while($rs = mysql_fetch_array($sql2))
- {
- $town=$rs[0];
- $q="select * from institute where address like '%".$town."%' ";
- //echo $town;
- //echo $q;
- //exit();
- $sql3 = mysql_query($q);
- if(!$sql3) { echo mysql_error();}
- while($rs1 = mysql_fetch_array($sql3))
- {
- ?>
- <table width='93%' border='0' align='center' cellpadding="0" cellspacing="0" bordercolor="#000066" >
- <tr align="center">
- <td colspan="2" bgcolor="#CC3333" class="text1"><strong>Centre
- Details</strong></td>
- </tr>
- <tr>
- <td width="30%" valign="top" class="text1"><strong> Town</strong></td>
- <td width="70%" valign="top"><?php echo $town;?></td>
- </tr>
- <tr>
- <td valign="top" class="text1"><strong> state</strong></td>
- <td valign="top"> <?php echo $rs1[state];?> </td>
- </tr>
- <tr>
- <td valign="top" class="text1"><strong> Centre</strong></td>
- <td valign="top"> <?php echo $rs1[address];?> </td>
- </tr>
- </table>
- <?php }
- } ?>
- <p align="center"> </p>
- </div>
- <?php require("../include/right.php"); ?><?php require("../include/footer.php"); ?>
- </body>
- </html>