how to get <td> value from different resultset in one table ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vaishakhi
    New Member
    • Aug 2012
    • 3

    how to get <td> value from different resultset in one table ?

    Code:
    	$outresult=mysql_query($outquery) or mysql_error();
                while ($inrow = mysql_fetch_array($inresult)) {
    				?>
                    <tr align="center">
                         <td> <?php echo $inrow['emp_name'];?></td>
                         <td><?php echo $inrow['entrance_date'];?></td>
                         <td><?php echo $inrow['entrance_time'];?></td>
                        <?php 
    					while ($outrow = mysql_fetch_array($outresult)) 
    					{ ?>
                         <td><?php echo $outrow['entrance_time']; ?> </td>
                        <?php 	
    					}  ?>
                     </tr>                 
                <?php	
    			}
    i attach my view i want that 2nd td in 2nd row
    Attached Files
  • Exequiel
    Contributor
    • Jul 2012
    • 288

    #2
    Code:
     $outresult=mysql_query($outquery) or mysql_error();
                while ($inrow = mysql_fetch_array($inresult)) {
                    ?>
                    <tr align="center">
                     <?php 
                        while ($outrow = mysql_fetch_array($outresult)) 
                        { ?>
                         <td> <?php echo $inrow['emp_name'];?></td>
                         <td><?php echo $inrow['entrance_date'];?></td>
                         <td><?php echo $inrow['entrance_time'];?></td>
                       
                         <td><?php echo $outrow['entrance_time']; ?> </td>
                        <?php     
                        }  ?>
                     </tr>                 
                <?php    
                }

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      Exequiel, that's incorrect as well.

      vaishaki, if you're sure that the order and number of records is the same in both recordsets, you can increment the out recordset at the same time as the in without using the while loop.

      Comment

      Working...