Answer the question
In order to leave comments, you need to log in
Can't save(), remove() on an object?
Actually, the problem is that this code does not change the value in the table.
$obj = $modx->getObject('LatestSite', array('user_id' => $customer));
$obj->set('site_id', $_POST['siteid']);
$obj->save();
<?xml version="1.0" encoding="UTF-8"?>
<model package="testpackage" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
<object class="LatestSite" table="latest_site" extends="xPDOObject">
<field key="user_id" dbtype="int" precision="10" phptype="integer" null="false" />
<field key="site_id" dbtype="int" precision="10" phptype="integer" null="false" />
</object>
</model>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question