Jump to content

I need help quickly!


Bojan86

Recommended Posts

It's not long, I don't why I posted it in attachment... :)

Here you go....

 

<table width="400" border="0" align="center" cellpadding="3" cellspacing="0">

<tr>

<td><strong>View Guestbook | <a href="guestbook.php">Sign Guestbook</a> </strong></td>

</tr>

</table>

<br>

 

<?php

 

$host="localhost"; // Host name

$username="root"; // Mysql username

$password=""; // Mysql password

$db_name="test"; // Database name

$tbl_name="guestbook"; // Table name

 

// Connect to server and select database.

mysql_connect("$host", "$username", "$password")or die("cannot connect server");

mysql_select_db("$db_name")or die("cannot select DB");

 

$sql="SELECT * FROM $tbl_name";

$result=mysql_query($sql);

 

while($rows=mysql_fetch_array($result)) {

?>

<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">

<tr>

<td><table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">

<tr>

<td>ID</td>

<td>:</td>

<td><? echo $rows['id']; ?></td>

</tr>

<tr>

<td width="117">Name</td>

<td width="14">:</td>

<td width="357"><? echo $rows['name']; ?></td>

</tr>

<tr>

<td>Email</td>

<td>:</td>

<td><? echo $rows['email']; ?></td>

</tr>

<tr>

<td valign="top">Comment</td>

<td valign="top">:</td>

<td><? echo $rows['comment']; ?></td>

</tr>

<tr>

<td valign="top">Date</td>

<td valign="top">:</td>

<td><? echo $rows['datetime']; ?></td>

</tr>

</table></td>

</tr>

</table>

<BR>

<?php

}

mysql_close(); //close database

?>

Link to comment
https://forums.phpfreaks.com/topic/160679-i-need-help-quickly/#findComment-847958
Share on other sites

OK, this is what it shows...

<table width="400" border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td><strong>View Guestbook | <a href="guestbook.php">Sign Guestbook</a> </strong></td>
</tr>
</table>
<br>

<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td><table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td>ID</td>
<td>:</td>
<td><? echo $rows['id']; ?></td>
</tr>
<tr>
<td width="117">Name</td>
<td width="14">:</td>
<td width="357"><? echo $rows['name']; ?></td>
</tr>
<tr>
<td>Email</td>
<td>:</td>
<td><? echo $rows['email']; ?></td>
</tr>
<tr>
<td valign="top">Comment</td>
<td valign="top">:</td>
<td><? echo $rows['comment']; ?></td>
</tr>
<tr>
<td valign="top">Date</td>
<td valign="top">:</td>
<td><? echo $rows['datetime']; ?></td>
</tr>
</table></td>
</tr>
</table>
<BR>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td><table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td>ID</td>
<td>:</td>
<td><? echo $rows['id']; ?></td>
</tr>
<tr>
<td width="117">Name</td>
<td width="14">:</td>
<td width="357"><? echo $rows['name']; ?></td>
</tr>
<tr>
<td>Email</td>
<td>:</td>
<td><? echo $rows['email']; ?></td>
</tr>
<tr>
<td valign="top">Comment</td>
<td valign="top">:</td>
<td><? echo $rows['comment']; ?></td>
</tr>
<tr>
<td valign="top">Date</td>
<td valign="top">:</td>
<td><? echo $rows['datetime']; ?></td>
</tr>
</table></td>
</tr>
</table>
<BR>

Link to comment
https://forums.phpfreaks.com/topic/160679-i-need-help-quickly/#findComment-847964
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.