<?php
$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name=""; // Database name
$tbl_name="comment"; // Table name
// connect to the mysql server
$link = mysql_connect($host, $username, $password)
or die ("Could not connect to mysql because ".mysql_error());
// select the database
$db_found = mysql_select_db($db_name)
or die ("Could not select database because ".mysql_error());
$result=mysql_query("select * from $tbl_name");
while($row=mysql_fetch_assoc($result)){
echo "ID: ".$row['id']."<br>";
echo "name: ".$row['name']."<br>";
echo "comment: ".$row['comment']."<br>";
}
?>
hello is there any way to insert the data into a table.
ive had a little go but it doesnt seem to like it
<table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td>ID</td>
<td>:</td>
<td> echo ".$row['id']." </td>
</tr>
</table>
i get a parse error