I feel a little stupid here, as it seems like an easy task I have to do, but now I have spend forever to figure it out - still with no result.
I have an accepturlpage where DIBS is sending a bunch of hidden fields to, and now I need to catch the [statuscode] to UPDATE a field in a row in my database WHERE [orderid] matches.
Right now I have this code which changes the status code all right but I need of course the "statuscode" to be whatever DIBS is sending and the same goes for "ordered". So how do I make these two figures variables?
Niels
I have an accepturlpage where DIBS is sending a bunch of hidden fields to, and now I need to catch the [statuscode] to UPDATE a field in a row in my database WHERE [orderid] matches.
Right now I have this code which changes the status code all right but I need of course the "statuscode" to be whatever DIBS is sending and the same goes for "ordered". So how do I make these two figures variables?
<?php
$db =& JFactory::getDBO();
$query = $db->getQuery(true);
$query->update('db_betalinger');
$query->set('statuscode = "6"');
$query->where('orderid = "TC8168SHF"');
$db->setQuery($query);
$result = $db->query();
?>Niels
Hi Neils,
You don't say where this code is. Assuming it's in the On Load event of your form, or a custom event then this should work as ChronoForms adds the URL values to the $form->data array
Bob
You don't say where this code is. Assuming it's in the On Load event of your form, or a custom event then this should work as ChronoForms adds the URL values to the $form->data array
<?php
$db =& JFactory::getDBO();
$where = "`statuscode` = '{$form->data['statuscode']}' AND `orderid` = '{$form->data['orderid']}'";
$query = $db->getQuery(true);
$query->update('db_betalinger');
$query->where($where);
$db->setQuery($query);
$result = $db->query();
?>Bob
Hi Bob
Thank you for your answer, but I ended up with something different
<?php
$varStatuscode = $_POST["statuscode"];
$varOrderid = $_POST["orderid"];
$sql="UPDATE db_betalinger SET statuscode='$varStatuscode' WHERE orderid='$varOrderid' ";
$res=mysql_query($sql);
?>
I am very new in php and have a hard time figuring out when to use the different methods to get to the result.
Thank you for your answer, but I ended up with something different
<?php
$varStatuscode = $_POST["statuscode"];
$varOrderid = $_POST["orderid"];
$sql="UPDATE db_betalinger SET statuscode='$varStatuscode' WHERE orderid='$varOrderid' ";
$res=mysql_query($sql);
?>
I am very new in php and have a hard time figuring out when to use the different methods to get to the result.
This topic is locked and no more replies can be posted.
