denoteone Posted March 20, 2009 Share Posted March 20, 2009 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> Quote Link to comment https://forums.phpfreaks.com/topic/150385-solved-echo-data-from-db/ Share on other sites More sharing options...
denoteone Posted March 20, 2009 Author Share Posted March 20, 2009 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> Quote Link to comment https://forums.phpfreaks.com/topic/150385-solved-echo-data-from-db/#findComment-789777 Share on other sites More sharing options...
revraz Posted March 20, 2009 Share Posted March 20, 2009 Use mysql_error() after your query and the error should be apparent. $result = mysql_query($query) or die (mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/150385-solved-echo-data-from-db/#findComment-789785 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.