This is killing me anyone have any insight ?
-
☆ A M B ☆
- 3,141 Posts
Why don't you just use something like this?
$base_path = !empty($base_path) ? $base_path : $modx->getOption('core_path').'components/tracker/';
$modx->addPackage('tracker',$base_path.'model/','');
$c = $modx->newQuery('LogAccess');
$c->where(array(
'ip_addr' => '92.20.1.34',
));
$c->select(array('id'));
$c->limit(1);
/* This bit is just for logging the SQL */
$c->prepare();
echo $c->toSQL();
/* Get the object */
$object = $modx->getObject('LogAccess', $c);
var_dump($object->toArray());
return 'Done';
Thanks mark ill give that a try, what is the quickest way to run an update on that row, need to set visited = 1.
That's telling you that the getObject() call failed.
He guys,
Thats what I dont understand the query that is being outputted is pulling a row from the database, but xpdo does not seem to be pullling anything.
[ed. note: datarecall last edited this post 13 years, 10 months ago.]
Have you double-checked you are actually getting any data from that query by copy/pasting the generated SQL statement into a db client (eg phpmyadmin).
At least then you can eliminate the possibility of the query not being correct, or that data is not being returned as expected at the db level.
whats your xml-schema of this package?