I don't understand this at all.
I have a class which is roughly the following:
<?php
class pageData
{
private $Bookmark;
private $Program;
private $Agency;
//With appropriate setters/getters
}
?>
Then I try to create a new object, pass it around a bit, and eventually end up with:
mysql_query("INSERT INTO Records (Bookmark, Program, Agency)
VALUES ('$data->getBookmark()', '$data->getProgram()', '$data->getAgency()')");
I end up with Notice: Undefined property: pageData::$getBookmark in...
Notice: Undefined property: pageData::$getProgram in...
Notice: Undefined property: pageData::$getAgency in...
Using PhpMyAdmin it looks like Bookmark becomes 0 and Program becomes () and Agency is empty.
If I type
print($data->getBookmark());
it prints out the bookmark. if I type
echo $data->getBookmark();
it prints out. Why doesn't it work when I try to insert it into the database, too?