I am new to php and I just developed a code looking at some tutorials.
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
include 'db_connect.php';
$query = "SELECT id, date, ip, website FROM response";
$result = mysql_query($query);
$dateArray=array();
while($row = mysql_fetch_array($result) or die (mysql_error()))
{
echo "Date :{$row['date']} <br>" .
"IP : {$row['ip']} <br>" .
"Url : {$row['website']} <br><br>";
}
?>
This displays record in this format
Date :2012-11-23 17:07:57
IP : 198.169.127.145
Url : 2webdesign.com
Date :2012-11-25 21:45:11
IP : 198.169.127.145
Url : 2webdesign.com
Date :2012-11-25 21:45:51
IP : 198.169.127.145
Url : www.sarcan.ca
I want to display records where date is on top and data is displayed under date
For instance
Date: 25 November 2012
Url
IP
URl
IP
Date 26 Nov 2012
URL
IP
URL
IP
Secondly I also want to have an option to export this to Excelsheet.
Can anybody have a look at the code and help me out.
I know this is very basic code as I just have a basic idea oh php
Please keep in mind all the comments to your original post, because they are all valid. Here is a possible solution (untested, so may need light modification) to the first part of your question: