object method with column data from a row in a table.
Here's the method that returns the array:
Code: Select all
public function editPage ($id) {
global $db;
$query = "SELECT * FROM web_content WHERE id_content = '$id'";
$result = mysql_query($query, $db->dbc) or die('Failed to retrieve
page to edit.');
while ($row=mysql_fetch_array($result)) {
$edit_values[] = $row;
}
return $edit_values;
} displays the data, including data for ['page_name'], indicating that
the array is being passed correctly.
However, $stuff['page_name'] returns nothing.
$
Code: Select all
stuff = $admin->editPage($id);
echo "Page_name = " . $stuff['page_name'] . "<br/><br/>"; // returns:
Page_name =
echo '<pre>';
print_r ($stuff); // Returns the array with all of its values
including page_name
echo '</pre>'; except in the print_r statement.
What's going on. I've racked my brain.
What stupid thing am I overlooking?
--Kenoli