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

code not working

232 100+
i hav 2 tables
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
  1. <?php
  2.     session_start();   
  3.  
  4. ?>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8.    <title></title>
  9.    <meta name="generator" content="Microsoft FrontPage 5.0" />
  10.    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  11.    <meta name="description" content="" />
  12.    <meta name="keywords" content="" />
  13.    <meta name="author" content="" />
  14. <link rel="stylesheet" href="../include/style.css" type="text/css" />
  15. </head>
  16. <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  17.  
  18. <?php require("../include/header.php"); ?>
  19. <?php require("../include/left.php"); ?>
  20.  
  21.  <div class="heading"> 
  22.     welcome all
  23.    </div>
  24.      <div class="text"> 
  25.     <?php
  26.  $sql2 = mysql_query("select * from town");
  27.  //echo  $sql2;
  28.  //exit();
  29.  
  30.    if(!$sql2) { echo mysql_error();}
  31.  
  32.    while($rs = mysql_fetch_array($sql2))
  33.    {
  34.    $town=$rs[0];
  35.    $q="select * from institute where address like '%".$town."%' ";
  36.    //echo $town;
  37.    //echo  $q;
  38.    //exit();
  39.    $sql3 = mysql_query($q);
  40.  
  41.  
  42.    if(!$sql3) { echo mysql_error();}
  43.  
  44.    while($rs1 = mysql_fetch_array($sql3))
  45.    {
  46.  
  47.    ?>
  48.  
  49.   <table width='93%' border='0' align='center' cellpadding="0" cellspacing="0" bordercolor="#000066" >
  50.  
  51.       <tr align="center"> 
  52.         <td colspan="2" bgcolor="#CC3333" class="text1"><strong>Centre 
  53.           Details</strong></td>
  54.       </tr>
  55.       <tr> 
  56.         <td width="30%" valign="top" class="text1"><strong> Town</strong></td>
  57.  
  58.       <td width="70%" valign="top"><?php echo $town;?></td>
  59.       </tr>
  60.  
  61.       <tr> 
  62.         <td  valign="top" class="text1"><strong> state</strong></td>
  63.         <td valign="top"> <?php echo $rs1[state];?> </td>
  64.       </tr>
  65.       <tr> 
  66.  
  67.         <td  valign="top" class="text1"><strong> Centre</strong></td>
  68.         <td valign="top"> <?php echo $rs1[address];?> </td>
  69.       </tr>
  70.       </table>
  71.     <?php  }
  72. }  ?>
  73.  
  74.   <p align="center">&nbsp; </p>
  75. </div>
  76.  
  77. <?php require("../include/right.php"); ?><?php require("../include/footer.php"); ?>
  78.  
  79. </body>
  80. </html>
Dec 7 '09 #1
2 1345
code green
1,726 Expert 1GB
Come on kkshansid.
You have made enough posts to know that "not working" is utterly meaningless.
Dec 7 '09 #2
kkshansid
232 100+
yes i know but i really cant find error
Dec 7 '09 #3

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

Similar topics

171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
0
by: George2 | last post by:
Hello everyone, From the definition of working set, it is a subset of virtual pages resident in physical memory -- from book Windows Internals. It means working set could not be larger than...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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,...
0
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...
0
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,...
0
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...

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.