I have a form setup to send data via SQL to an email. Everything works fine but my client would like the output in the email to be displayed in a more asthetic looking table. Here is the code that renders the email output:
while ($row = mysql_fetch_object($query)) {
$string .= "Store: ".$row->storenum."<br>"."Submitted Date: ".$row->created_at."<br>"."Transactions: ".$row->spacer."<br>"."11:00-11:30am: ".$row->Trans11."<br>"."11:30-12:00pm: ".$row->Trans1130."<br>"."12:00-12:30pm: ".$row->Trans12."<br>"."12:30-1:00pm: ".$row->Trans1230."<br>"."1:00-1:30pm: ".$row->Trans01."<br>"."1:30-2:00pm: ".$row->Trans0130."<br>"."Sales: ".$row->Spacer."<br>"."11:00-11:30am: ".$row->Sales11."<br>"."11:30-12:00pm: ".$row->Sales1130."<br>"."12:00-12:30pm: ".$row->Sales12."<br>"."12:30-1:00pm: ".$row->Sales1230."<br>"."1:00-1:30pm: ".$row->Sales01."<br>"."1:30-2:00pm: ".$row->Sales0130."<br>"."Scheduled Hours: ".$row->Spacer."<br>"."11:00-11:30am: ".$row->shedhr11."<br>"."11:30-12:00pm: ".$row->shedhr1130."<br>"."12:00-12:30pm: ".$row->shedhr12."<br>"."12:30-1:00pm: ".$row->shedhr1230."<br>"."".$row->shedhr01."<br>"."1:30-2:00pm: ".$row->shedhr0130."<br>"."Ideal Hours: ".$row->Spacer."<br>"."11:00-11:30am: ".$row->idhr11."<br>"."11:30-12:00pm: ".$row->idhr1130."<br>"."12:00-12:30pm: ".$row->idhr12."<br>"."12:30-1:00pm: ".$row->idhr1230."<br>"."1:00-1:30pm: ".$row->idhr01."<br>"."1:30-2:00pm: ".$row->idhr0130."<br>"."Actual Hours: ".$row->Spacer."<br>"."11:00-11:30am: ".$row->acthr11."<br>"."11:30-12:00pm: ".$row->acthr1130."<br>"."12:00-12:30pm: ".$row->acthr12."<br>"."12:00-12:30pm: ".$row->acthr1230."<br>"."1:00-1:30pm: ".$row->acthr01."<br>"."1:30-2:00pm: ".$row->acthr0130."<br>"."Difference: ".$row->Spacer."<br>"."11:00-11:30am: ".$row->diffhr11."<br>"."11:30-12:00pm: ".$row->diffhr1130."<br>"."12:00-12:30pm: ".$row->diffhr12."<br>"."12:30-1:00pm: ".$row->diffhr1230."<br>"."1:00-1:30pm: ".$row->diffhr01."<br>"."1:30-2:00pm: ".$row->diffhr0130."<br>"."Notes: ".$row->note."<br>";
}
Its one huge line pulling from the SQL database. I've tried using standard html to make a table out of this long line of code but the email stops sending and it displays no error message. My question is how should i go about setting up a table for this data. if i do it with that line, then i have problems. how can I chop it up and make a table out of this output? I need the different time slots(1:30-2:00pm for instance) as the table headers, and I need the data to be in the same column as the data for the coresponding time slot.. see diagram:(data in blue is data that is sumitted in the form and displayed here via sql)
Store number: 5003 | 11:00-11:30am | 11:30-12:00pm | 12:00-12:30pm |12:30-1:00pm | 1:00-1:30 pm |1:30-2:00pm |
Transactions: | 20 | 12 |
Sales: | 234 | 155 |
Scheduled Hours: | 23 | 45 |
Actual Hours: | 21 | 123 |
Ideal Hours: | 17 | 123 |
Difference: | 4 | 0 |
This is how i need it to look when finished.
--------------------------------------------------------------------------------------------------------------------------
The folowing is how it looks right now with the code as is:
Store: 5001
Submitted Date: 2009-09-18
Transactions:
11:00-11:30am: 233
11:30-12:00pm: 12
12:00-12:30pm: 365
12:30-1:00pm: 325
1:00-1:30pm: 123
1:30-2:00pm: etc
Sales:
11:00-11:30am:
11:30-12:00pm:
12:00-12:30pm:
12:30-1:00pm:
1:00-1:30pm:
1:30-2:00pm:
Scheduled Hours:
11:00-11:30am:
11:30-12:00pm:
12:00-12:30pm:
12:30-1:00pm:
1:00-1:30pm:
1:30-2:00pm:
Ideal Hours:
11:00-11:30am:
11:30-12:00pm:
12:00-12:30pm:
12:30-1:00pm:
1:00-1:30pm:
1:30-2:00pm:
Actual Hours:
11:00-11:30am:
11:30-12:00pm:
12:00-12:30pm:
12:00-12:30pm:
1:00-1:30pm:
1:30-2:00pm:
Difference:
11:00-11:30am:
11:30-12:00pm:
12:00-12:30pm:
12:30-1:00pm:
1:00-1:30pm:
1:30-2:00pm:
Thank you in advance for any help in advance that you can give me on this. I normally get what i need via googling PHP/HTML help pages, but the help pages i have found have not helped me get it, and its over my head this time.