1 Replies - 413 Views - Last Post: 12 December 2011 - 08:35 AM Rate Topic: -----

#1 Syfer  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 190
  • Joined: 08-October 10

having a hard time with my table arrangement

Posted 12 December 2011 - 08:09 AM

as you can see in the picture the table date and time is not arranged properly
after looping it the next date and time goes to its side on and on
 if(isset($_REQUEST["action"]) && $_REQUEST["action"] == "checked" && $_REQUEST["id"]){
				$id=$_REQUEST["id"];
				$query = mysql_query("SELECT * FROM appointments WHERE dent_id='".$id."'") or die(mysql_error());
            $total_results = mysql_num_rows($query);
	      	if ($total_results > 0){
				while($resulta=mysql_fetch_array($query)){			
				echo "<div style=\"
				top:100px;
				width:265px;
				border:10px solid #CCCCCC;
				\">";
					echo  "Days/time not available <br/><br/>";
				echo "<table border=\"1\">";
				echo "<tr><td>Date</td><td>Time</td></tr>";	

		for($i = 0; $i < mysql_num_rows($query); $i++){
                        $date= mysql_result($query,$i,'date');
						$time= mysql_result($query,$i,'time');	
						
	      echo "<td>".$date."</td>";
		  echo "<td>".$time."</td>"; 
			  
			  
			}
				 echo "</table>"; 
				echo "</div>";
			
				}
		
		 }else{
		  echo "<div style=\"
				top:100px;
				width:265px;
				border:10px solid #CCCCCC;
				\">Available on all days and time..</div>";
		 }
		}



here's the codes needed for that
any help would be appreciated well..

Attached image(s)

  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: having a hard time with my table arrangement

#2 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2910
  • View blog
  • Posts: 10,076
  • Joined: 08-August 08

Re: having a hard time with my table arrangement

Posted 12 December 2011 - 08:35 AM

You're missing <tr> .. . </tr>
	echo "<tr><td>".$date."</td><td>".$time."</td></tr>"; 

Was This Post Helpful? 2
  • +
  • -

Page 1 of 1