Simple XML/XSLT Parser
<?php
$xml_filename = 'name.xml';
$xsl_filename = 'name.xsl';
$doc = new DOMDocument();
$xsl = new XSLTProcessor();
$doc->load($xsl_filename);
$xsl->importStyleSheet($doc);
$doc->load($xml_filename);
$content = $xsl->transformToXML($doc);
?>MySQL snippet with cursors:
DECLARE done int default 0;
DECLARE currentProfileID bigint;
DECLARE dateCreatedPrm DATETIME;
DECLARE profileCursor CURSOR FOR SELECT ID FROM Profiles WHERE ID NOT IN (SELECT pID FROM Profiles_storage);
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
START TRANSACTION;
OPEN profileCursor;
REPEAT
FETCH profileCursor INTO currentProfileID;
IF NOT done THEN
SELECT date_created INTO dateCreatedPrm FROM Accounts WHERE ID = (SELECT account_id FROM Profiles WHERE ID = currentProfileID);
CALL Routine_add(currentProfileID, asd, DATE_ADD(dateCreatedPrm, INTERVAL 2 YEAR));
END IF;
UNTIL done
END REPEAT;
CLOSE profileCursor;
COMMIT;