Well i need help displaying mysql results in a html table.
The table consits of 6 columns and 20 rows.
I have a html form that has 6 input boxes. Each box inputs that info to a different database in a mysql database. I have 6 tables in my mysql database.
My form works and inputs the data into each table in my mysql database just fine.
So say i input the textboxes on my form where i submit to my database with a word in each. Thats 6 different words. I want word 1 in the first column of the first row word 2 in second column of first row and so on till it has done 6 columns on the first row.
Then say i go back to my form and input 6 more different words. I want to do the same as the first but on a new row. And so on..
Here is what i have atm. Unfortunately it keeps displaying the next submitted results in the next column instead of starting a new row.
Code: Select all
<?PHP
include 'mysql_connect.php';
echo "<table border='1' width='100%' cellspacing='0' cellpadding='0'>";
$query=mysql_query("select * from news_posts, realname, skill, favmap,
ctwep, twep") or die("Error Occured,plz try again");
$left = true;
while($row=mysql_fetch_array($query))
{
if ($left)
{
echo "<tr>";
}
echo "<td>";
echo $row['title'];
echo"</td>";
echo "<td>";
echo $row['realname'];
echo"</td>";
echo "<td>";
echo $row['skill'];
echo"</td>";
echo "<td>";
echo $row['favmap'];
echo"</td>";
echo "<td>";
echo $row['ctwep'];
echo"</td>";
echo "<td>";
echo $row['twep'];
echo"</td>";
if (!$left)
{
echo"</tr>";
}
$left = !$left;
}
echo"</table>";
?>
