1
votes

I am using Propel ORM and I set everything that must be from Propel Documentation. I have tables and when i echo the result from some Table row the result is just NULL, and NULL for everything. Of course these tables/rows are not empty. It works fine with standart query. The problem is that there are not errors, too and thats why i can't find the solution and I can'tt explain the problem, like I want. I am new with Propel and want to use it. Please, if there is someone with expirience to help me. I am using MySQL. The code is just standart:

 // setup the autoloading
 require_once '../vendor/autoload.php';

 // setup Propel
 require_once '../vendor/bin/generated-conf/config.php';

 $author = new Authors();

 echo '<pre>';
 var_dump($author);
 echo '</pre>';

The table is not empty.

2
You will need to post specific codes here.Won Jun Bae
sry, this is the code: require_once '../vendor/autoload.php'; // setup Propel require_once '../vendor/bin/generated-conf/config.php'; $author = new Authors(); echo '<pre>'; var_dump($author); echo '</pre>';gdfgdfg

2 Answers

0
votes
$author = new Authors();

Is not retrieving all of the rows in Authors (is the table named author or authors?). For that, you need to use a query:

$q = \AuthorsQuery::create();
$authors = $q->find();
foreach ($authors as $author) {
    var_dump($author->toArray());
}