You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more
I've got data being returned by a database search (using php) that I want to automatically format into a table (or something similar). Current output is this:
Item: 15675
Image = e:\woodward\woodward_9450006884.tif
Account = 3030803
Invoice = 405632Item: 21711
Image = e:\woodward\woodward_9460005712.tif
Account = 3006036
Invoice = 425632Item: 39762
Image = e:\woodward\woodward_9490002689.tif
Account = 580002
Invoice = 445632
This is the php code that creates the output:
// dumpResults of a select statement
public function dumpResults($rest) {$response = "";
if ($rest) {
foreach ($rest as $item) { // split up items
$response .= "Item: ".$item["Name"]."";
foreach ($item["Attributes"] as $attribute => $value) { // split up attributes
if (is_array($value)) {
foreach($value as $onevalue) { // if array of values
$response .= "Â Â Â $attribute = $onevalue";
}
} else { // if single value
$response .= "Â Â Â $attribute = $value";
}
}
$response .= "";
}
} else {
$response = "";
}
return $response;
}
/**
* Clear public parameters
*
*/
You may have guessed I'm not good at this stuff! Any pointers as to what I should be looking at to get a better result?
12
Actually that php code is no help is it!! Anyway I'm guessing that I should address my issue by tackling the php code that is creating the output - so I'm going to have a go at that before I try something else.