Jump to content

[SOLVED] echo data from DB


denoteone

Recommended Posts

I am having a hard time getting my data to to echo  can anyone see what i am doing wrong?

 

<table>
<tr>
<td>IP</td><td>Whois Data</td><td>time</td><td>Date</td><td>Reffer</td><td>Page Visited</td></tr>
<?php
$today= date("d");
require_once('visitors_connections.php')
mysql_select_db($database_visitors, $visitors);
$query  = "SELECT * FROM visitor_list WHERE visitor_day is equal to '$today'";
$result = mysql_query($query);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
    echo '<td>{$row['visitor_ip']} </td>
         <td>{$row['visitor_whois']} </td>
         <td>{$row['visitor_min']} : {$row['visitor_hour']} </td>
	 <td>{$row['visitor_day']} , {$row['visitor_month']} {$row['visitor_year']} </td>
	 <td>{$row['visitor_ref']}</td>
	 <td>{$row['visitor_page']}</td>';
}

?>

</table>

Link to comment
https://forums.phpfreaks.com/topic/150385-solved-echo-data-from-db/
Share on other sites

I made some tweaks....

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table>
<tr>
<td>IP</td><td>Whois Data</td><td>time</td><td>Date</td><td>Reffer</td><td>Page Visited</td></tr>
<tr>

<?PHP
ini_set("display_errors","2");
ERROR_REPORTING(E_ALL);

$today= date("d");
echo $today;
require_once('visitors_connections.php');
mysql_select_db($database_visitors, $visitors);
$query  = "SELECT * FROM visitor_list WHERE visitor_day = '$today'";
$result = mysql_query($query);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
    echo '<td>{$row['visitor_ip']} </td>
         <td>{$row['visitor_whois']} </td>
         <td>{$row['visitor_min']} : {$row['visitor_hour']} </td>
	 <td>{$row['visitor_day']} , {$row['visitor_month']} {$row['visitor_year']} </td>
	 <td>{$row['visitor_ref']}</td>
	 <td>{$row['visitor_page']}</td>';
}

?>


</tr>
</table>
</body>
</html>

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.