View Full Version : how to separate individual fields instead of $col_value

04-14-2012, 11:49 PM
Can someone show me a short example of how to separate individual fields pulled from a line of code such as this:

while ($line = pg_fetch_array($inventoryresult, null, PGSQL_ASSOC)) {

foreach ($line as $col_value) {
echo "$col_value\n";
echo "\t</tr>\n";
echo "</table>\n";

I want better control over each specific field than this method dumps out.

04-15-2012, 12:38 AM
Simply replace what is inside the foreach loop with the code to handle each individual field the way you do want or replace the entire loop with separate code for each property within the $line object that you want to process.

04-16-2012, 12:06 AM
Could you post a small example? Nothing fancy by any means, but I am totally having writers block....