HOME
TUTORIAL
∇
Applets
Comments
CSS
Document Tags
Embed
Fonts
Forms
Frames
Images
Lines & Paragraphs
Links
Lists
Logical Tags
Scripts
Sounds
Symbols
Tables
Weird Tags
FORUM
∇
HTML Help
Web Design
Programming Languages
Web Hosting
Domain Names
Marketing
Community
QUICK LIST
CSS
HTML Help Forum
FAQ
Search
Memberlist
Register
Profile
Log in to check your private messages
Log in
Register
- Not registered yet? Got something to say?
Join HTML Code Tutorial
!
PHP - couldn't get my code to display 2 tables side by side
HTML Help Forum
->
HTML Table
View previous topic
::
View next topic
Author
Message
velocity27
Joined: 19 Feb 2009
Posts: 2
Posted: Thu Feb 19, 2009 6:15 pm
PHP - couldn't get my code to display 2 tables side by side
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
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
Posted: Thu Feb 19, 2009 10:58 pm
Found this one -> http://www.htmlcodetutorial.com/help/ar
Will try it and update the post
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
HTML Help Forum
->
HTML Table
All times are GMT - 8 Hours
Page
1
of
1
Jump to:
Select a forum
Announcements
----------------
Announcements
HTML Help
----------------
Member Tutorials
General HTML
HTML Form
HTML Table
HTML Frame
CSS
DHTML
SSI
MySpace
HTML Tools
Web Design
----------------
Images & Graphics
Templates
Multimedia
Programming Languages
----------------
Javascript
PHP
Perl
ASP
Others
Web Hosting
----------------
Free Hosting
Shared Hosting
Dedicated, Managed, and Co-located Hosting
Hosting Business and Reseller Hosting
Domain Names
----------------
Registrars
Tools
For Sale, Wanted, & Appraisals
Expired Domains
Monetization
Legal Issues
Marketing
----------------
SEO
PPC
Affiliate Marketing
Other Internet Marketing
Community
----------------
Miscellaneous
Website Review
Introduce Yourself
Feedback
Praise
Errors
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
Your Ad Here
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
DARFUR
Get a
Stop the Genocide
poster at
SaveDarfur.org
.
Also see
Eyes on Darfur
.
HOSTING / DESIGN
$1.99 Domain Registration
Cheap Web Hosting
Website Templates
MAKE MONEY
Sell Domain Names
Sell Website Templates
Home
|
Tutorials
|
Forum
|
Quick List
|
Link Directory
|
About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial