ok i think that i am missing something here but i not sure what.
i have a function with a class that is supposed to take all the data make a query and then put into an array the data i would like to collect later
function
function getDataLoop($strDbType, $table, $fields, $condition){
if(!$this->dbConn($strDbType)) return false;
$result = mysql_query("SELECT * FROM $table $condition");
while($myrow = mysql_fetch_assoc($result))
{
foreach ($fields as &$value) {
$loop[$value] .= $myrow[$value];
}
}
return $loop;
if ($result) {
$message = 'Yay the query was successfully run555.';
}else{
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: <em>' . $query . '</em>';
die($message);
}
}
within my page that i am calling it
$loop = $database->getDataLoop($strDbType, "pages", array("page_name", "id"), "");
foreach ($loop as $key => &$value)
{
echo '<strong>'.$value."</strong><br />";
}
now it puts it into an array but i dont think that the array is correct. when i echo out the loop values it does it like this
HomeProductsBlogHelpContact
12345
instead of like this
Home
Products
Blog
Help
Contact
1
2
3
4
5
im not sure where im going wrong.
thanks in advance