HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
PHP - couldn't get my code to display 2 tables side by side
Post new topic   Reply to topic    HTML Help Forum -> HTML Table
View previous topic :: View next topic  
Author Message
velocity27



Joined: 19 Feb 2009
Posts: 2

PostPosted: Thu Feb 19, 2009 6:15 pm     PHP - couldn't get my code to display 2 tables side by side Reply with quote

Can any one help please? Sought of new to this...

Am querying & displaying data from two different MYSQL tables. And wanted this to display "side by side". But it always dispalys one after the other Sad



thanks in advance!



<?php
$con = mysql_connect("localhost","TRD","mysql");

if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$db_list = mysql_list_dbs($con);

$i = 0;

$db_count = mysql_num_rows($db_list);

echo "<table border='3' float:left; border-collapse:collapse;>
<tr>
<th>TABLE_#</th>
<th>TABLE_NAME</th>
</tr>";

while ($i < $db_count)
{
echo "<tr>";
echo "<td>".$i."</td>";
echo "<td>".mysql_db_name($db_list, $i)."</td>";
echo "<tr>";

$i++;

}mysql_close($con);

?>





<?php

$con = mysql_connect("localhost","qa1","mysql");

if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("qa1", $con);

$sql_select=mysql_query("Select * from demotab");
echo "<table border='3'; float:right; border-collapse:collapse;>
<tr>
<th>Employee_ID</th>
<th>Employee_NAME</th>
</tr>";




while ($sql_rows = mysql_fetch_array($sql_select))
{
echo "<tr>";
echo "<td>".$sql_rows['ID']."</td>";
echo "<td>".$sql_rows['Name']."</td>";
echo "</tr>";
}
?>
Code:
velocity27



Joined: 19 Feb 2009
Posts: 2

PostPosted: Thu Feb 19, 2009 10:58 pm     Found this one -> http://www.htmlcodetutorial.com/help/ar Reply with quote

Will try it and update the post
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial