I need help with scripting. This is the script currently used:
<?
$query = "select * from vacancy_rego";
include("../classes/database.php"
;
$database = new database();
$result=$database->openConnectionWithReturn($query);
while ($row = mysql_fetch_assoc($result))
{
echo "</br>";
$first = true;
foreach ($row as $name =>$col)
{
if (!$first)
echo " | ";
echo "$name = $col";
$first = false;
}
echo "</br>";
}
?>
What happens with this script is that it return the data as show below:
id = 1 | postcode = 3000 | source = A
id = 2 | postcode = 3001 | source = B
etc
BUT I would like the data to be returned in the following format:
id | postcode | source
1 | 3000 | A
2 | 3001 | B
Can someone please help to modify the script above to fulfill the last display format.
THANKS
<?
$query = "select * from vacancy_rego";
include("../classes/database.php"
$database = new database();
$result=$database->openConnectionWithReturn($query);
while ($row = mysql_fetch_assoc($result))
{
echo "</br>";
$first = true;
foreach ($row as $name =>$col)
{
if (!$first)
echo " | ";
echo "$name = $col";
$first = false;
}
echo "</br>";
}
?>
What happens with this script is that it return the data as show below:
id = 1 | postcode = 3000 | source = A
id = 2 | postcode = 3001 | source = B
etc
BUT I would like the data to be returned in the following format:
id | postcode | source
1 | 3000 | A
2 | 3001 | B
Can someone please help to modify the script above to fulfill the last display format.
THANKS