Welcome Guest, Not a member yet? Register   Sign In
Please help me convert this php to CI code
#1

[eluser]Jbeasley6651[/eluser]
$listingCounter = 1;
foreach ($updateRecordsArray as $recordIDValue) {

$query = "UPDATE records SET recordListingID = " . $listingCounter . " WHERE recordID = " . $recordIDValue;
mysql_query($query) or die('Error, insert query failed');
$listingCounter = $listingCounter + 1;
}



I'm use to CAKE as a framework and i'm still learning CI have stand alone php/ajax code that works fine and i really need help converting it to code igniter.

I'm placing this inside a controller (i'm opting out of models at the moment).

For cake it would be something like...

foreach ($updateRecordsArray as $recordIDValue) {
$this->Record->id = $recordIdValue;
$this->Record->saveField('recordListingID', $listingCounter);
}


Messages In This Thread
Please help me convert this php to CI code - by El Forum - 05-25-2009, 08:46 AM
Please help me convert this php to CI code - by El Forum - 05-25-2009, 08:58 AM
Please help me convert this php to CI code - by El Forum - 05-25-2009, 09:18 AM
Please help me convert this php to CI code - by El Forum - 05-25-2009, 09:21 AM
Please help me convert this php to CI code - by El Forum - 05-25-2009, 09:24 AM
Please help me convert this php to CI code - by El Forum - 05-25-2009, 09:27 AM
Please help me convert this php to CI code - by El Forum - 05-25-2009, 09:30 AM
Please help me convert this php to CI code - by El Forum - 05-25-2009, 09:47 AM
Please help me convert this php to CI code - by El Forum - 05-25-2009, 10:03 AM
Please help me convert this php to CI code - by El Forum - 05-25-2009, 10:12 AM
Please help me convert this php to CI code - by El Forum - 05-25-2009, 10:18 AM
Please help me convert this php to CI code - by El Forum - 05-25-2009, 10:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB