Sunday, 27 April 2014

SugarCRM:: Custom Way to retrieve data from Database in SugarCRM.


<?php

 if(!defined('sugarEntry'))define('sugarEntry', true);
require_once('include/entryPoint.php');
require_once('include/database/DBManager.php');


$db=DbManagerFactory::getInstance();
        $execute = $db->query("SELECT name FROM users");

while($row = $db->fetchByAssoc($execute)){
$result_name = $row['name'];
}

echo $result_name;

?>

Tuesday, 22 April 2014

PHP in Jquery:: Demonstration: How to use PHP variable in Jquery!

This is just a small example to demonstrate the use of php variable in Jquery function.


<?php
 
    $name = "Danish";
 
    
    $js = <<<EOP
        <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                 alert(Hello+'$name');
            });
        </script>
EOP;


?>