here is the code i am using a wysiwyg for creating the pages
and i inserted the php code
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Untitled Page</title>
<style type="text/css">
body
{
background-color: #FFFFFF;
background-image: url(images/backgroundlou.jpg);
background-repeat: no-repeat;
color: #000000;
}
</style>
<style type="text/css">
a
{
color: #0000FF;
text-decoration: underline;
}
a:visited
{
color: #800080;
}
a:active
{
color: #FF0000;
}
a:hover
{
color: #0000FF;
text-decoration: underline;
}
</style>
<style type="text/css">
#TextArea1
{
border: 1px #C0C0C0 solid;
background-color: #FFFFFF;
color :#000000;
font-family: Arial;
font-size: 13px;
text-align: left;
}
</style>
</head>
<body>
<textarea name="TextArea1" id="TextArea1" style="position:absolute;left:379px;top:190px;width:592px;height:266px;z-index:0;" rows="15" cols="93"></textarea>
<body>
<?php
// info to connect to db
$host = 'localhost';
$user = 'ffffff';
$pass = 'ffffff';
$db = 'ffffff';
// connection to DB
$link = mysql_connect ($host,$user,$pass) or die ('Erreur : '.mysql_error() ) ;
mysql_select_db($db) or die ('Erreur :'.mysql_error()) ;
// compting the result and recuparating them
$select = 'SELECT nom,continent,coord FROM test';
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
$total = mysql_num_rows($result);
// if we get a result we display it in the text area
if($total) {
// start of table
echo '<table bgcolor="#FFFFFF">'."\n";
// first line of the table
echo '<tr>';
echo '<td bgcolor="#669999"><b><u>Continent</u></b></td>';
echo '<td bgcolor="#669999"><b><u>Coord</u></b></td>';
echo '<td bgcolor="#669999"><b><u>Player</u></b></td>';
echo '</tr>'."\n";
// displaying the result
while($row = mysql_fetch_array($result)) {
echo '<tr>';
echo '<td bgcolor="#CCCCCC">'.$row['continent'].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row['coord'].'</td>';
echo '<td bgcolor="#CCCCCC">'.$row['nom'].'</td>';
echo '</tr>'."\n";
}
echo '</table>'."\n";
// fin du tableau.
}
else echo 'Pas d\'enregistrements dans cette table...';
// on libère le résultat
mysql_free_result($result);
?>
</body>
</html>
i am a total newb when it comes to php i have this code working it used to call its own html page but i want to display the table in a text area and i have no clue